()
| 645 | // keeps the event loop open on its own, but fires for as long as the daemon |
| 646 | // is otherwise alive. |
| 647 | function startLockRefresh() { |
| 648 | if (_lockRefreshTimer) return; |
| 649 | const lockFile = getLockFilePath(); |
| 650 | _lockRefreshTimer = setInterval(function () { |
| 651 | try { |
| 652 | const now = new Date(); |
| 653 | fs.utimesSync(lockFile, now, now); |
| 654 | } catch (_) { /* lock gone / FS error: nothing we can do here */ } |
| 655 | }, LOCK_REFRESH_MS); |
| 656 | if (_lockRefreshTimer && typeof _lockRefreshTimer.unref === 'function') { |
| 657 | _lockRefreshTimer.unref(); |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | function stopLockRefresh() { |
| 662 | if (_lockRefreshTimer) { |
no test coverage detected