diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-12 23:06:13 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-12 23:06:13 +0100 |
commit | ddec9cf2faa774fd12a3b9cc0f1414198e52baa8 (patch) | |
tree | a1d7e56a7072973857001ce2db22c6439cfa092a /src/crypto/cryptoApi.ts | |
parent | 5a8d880ebd53d6436e78c9f242d20bfa3f50b8b8 (diff) | |
download | wallet-core-ddec9cf2faa774fd12a3b9cc0f1414198e52baa8.tar.xz |
only run crypto worker on half of available threads
Diffstat (limited to 'src/crypto/cryptoApi.ts')
-rw-r--r-- | src/crypto/cryptoApi.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/crypto/cryptoApi.ts b/src/crypto/cryptoApi.ts index 9a21d13a9..12b1c9708 100644 --- a/src/crypto/cryptoApi.ts +++ b/src/crypto/cryptoApi.ts @@ -203,6 +203,7 @@ export class CryptoApi { // only works in the browser // tslint:disable-next-line:no-string-literal concurrency = (navigator as any)["hardwareConcurrency"]; + concurrency = Math.max(1, Math.ceil(concurrency / 2)); } catch (e) { // ignore } |