fix navigator not defined
This commit is contained in:
parent
7fd68cb1fc
commit
6132b2657a
|
@ -22,7 +22,7 @@ import {
|
|||
SceneDetectionService,
|
||||
SceneDetectionMethod,
|
||||
} from 'types/machineLearning';
|
||||
import { CONCURRENCY } from 'utils/common/concurrency';
|
||||
import { getConcurrency } from 'utils/common/concurrency';
|
||||
import { getDedicatedCryptoWorker } from 'utils/crypto';
|
||||
import { ComlinkWorker } from 'utils/comlink';
|
||||
import { logQueueStats } from 'utils/machineLearning';
|
||||
|
@ -201,7 +201,7 @@ export class LocalMLSyncContext implements MLSyncContext {
|
|||
this.nSyncedFiles = 0;
|
||||
this.nSyncedFaces = 0;
|
||||
|
||||
this.concurrency = concurrency || CONCURRENCY;
|
||||
this.concurrency = concurrency || getConcurrency();
|
||||
|
||||
console.log('Using concurrency: ', this.concurrency);
|
||||
// timeout is added on downloads
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export const CONCURRENCY = Math.max(
|
||||
2,
|
||||
Math.ceil(navigator.hardwareConcurrency / 2)
|
||||
);
|
||||
import { runningInBrowser } from '.';
|
||||
|
||||
export const getConcurrency = () =>
|
||||
runningInBrowser() &&
|
||||
Math.max(2, Math.ceil(navigator.hardwareConcurrency / 2));
|
||||
|
|
Loading…
Reference in a new issue