Skip to content

Commit

Permalink
Only attempt to acquire wakelock if on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
jedahan authored and alexrudd2 committed Oct 4, 2023
1 parent 53b14a0 commit bed50de
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ export function startServer(port: number, device: string | null = null, enableCo

const begin = Date.now();
let wakeLock: any;
try {
wakeLock = new WakeLock("saxi plotting");
} catch (e) {
console.warn("Couldn't acquire wake lock. Ensure your machine does not sleep during plotting");
if (process.platform === 'darwin') {
try {
wakeLock = new WakeLock("saxi plotting");
} catch (e) {
console.warn("Couldn't acquire wake lock. Ensure your machine does not sleep during plotting");
}
}

try {
Expand Down

0 comments on commit bed50de

Please sign in to comment.