Skip to content

Commit

Permalink
refactor(settings): add comment to CPU_COUNT detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmlnc committed Dec 11, 2020
1 parent 800aea6 commit a78cab6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/settings.ts
Expand Up @@ -3,6 +3,10 @@ import * as os from 'os';

import { FileSystemAdapter, Pattern } from './types';

/**
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
*/
const CPU_COUNT = Math.max(os.cpus().length, 1);

export const DEFAULT_FILE_SYSTEM_ADAPTER: FileSystemAdapter = {
Expand Down

0 comments on commit a78cab6

Please sign in to comment.