make sure that worker is only called in child process, even if EncryptionWorker.ts was imported by main thread to make sure it was builded

This commit is contained in:
einhornimmond 2025-01-15 20:11:31 +01:00
parent 249c5dc32d
commit fdec1ccbb0

View File

@ -46,7 +46,7 @@ export const SecretKeyCryptographyCreateKey = (
return encryptionKeyHash.readBigUInt64LE()
}
if (CONFIG.USE_CRYPTO_WORKER === true) {
if (CONFIG.USE_CRYPTO_WORKER === true && typeof process.send === 'function') {
worker({
SecretKeyCryptographyCreateKey,
})