takt run 実行時に蓋閉じスリープを抑制

This commit is contained in:
nrslib 2026-02-11 22:56:41 +09:00
parent a50687a055
commit af4dc0722b
2 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ describe('preventSleep', () => {
expect(spawn).toHaveBeenCalledWith( expect(spawn).toHaveBeenCalledWith(
'/usr/bin/caffeinate', '/usr/bin/caffeinate',
['-di', '-w', String(process.pid)], ['-dis', '-w', String(process.pid)],
{ stdio: 'ignore', detached: true } { stdio: 'ignore', detached: true }
); );
expect(mockChild.unref).toHaveBeenCalled(); expect(mockChild.unref).toHaveBeenCalled();

View File

@ -8,10 +8,10 @@ const log = createLogger('sleep');
let caffeinateStarted = false; let caffeinateStarted = false;
/** /**
* takt実行中のmacOSアイドルスリープおよびディスプレイスリープを防止する * takt実行中のmacOSスリープを防止する
* -d: ディスプレイスリープ防止App Nap * -d: ディスプレイスリープ防止App Nap
* -i: アイドルスリープ防止 * -i: アイドルスリープ防止
* -s AC電源が必要なため * -s: システムスリープ防止AC電源接続時のみ有効
*/ */
export function preventSleep(): void { export function preventSleep(): void {
if (caffeinateStarted) { if (caffeinateStarted) {
@ -28,7 +28,7 @@ export function preventSleep(): void {
return; return;
} }
const child = spawn(caffeinatePath, ['-di', '-w', String(process.pid)], { const child = spawn(caffeinatePath, ['-dis', '-w', String(process.pid)], {
stdio: 'ignore', stdio: 'ignore',
detached: true, detached: true,
}); });