-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4079 from janhq/fix/factory-reset-hang-on-wiping-…
…data
- Loading branch information
Showing
5 changed files
with
78 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { cpuInfo } from 'cpu-instructions' | ||
|
||
// Check the CPU info and determine the supported instruction set | ||
const info = cpuInfo.cpuInfo().some((e) => e.toUpperCase() === 'AVX512') | ||
? 'avx512' | ||
: cpuInfo.cpuInfo().some((e) => e.toUpperCase() === 'AVX2') | ||
? 'avx2' | ||
: cpuInfo.cpuInfo().some((e) => e.toUpperCase() === 'AVX') | ||
? 'avx' | ||
: 'noavx' | ||
|
||
// Send the result and wait for confirmation before exiting | ||
new Promise<void>((resolve, reject) => { | ||
// @ts-ignore | ||
process.send(info, (error: Error | null) => { | ||
if (error) { | ||
reject(error) | ||
} else { | ||
resolve() | ||
} | ||
}) | ||
}) | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error('Failed to send info:', error) | ||
process.exit(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters