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