MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / isDockerContainer

Function isDockerContainer

scan-worker.js:156–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154// Docker file system operations (especially on network shares) can be 10-100ms per operation
155// vs <1ms for local file systems, so we need more parallel operations to maintain throughput
156function isDockerContainer() {
157 return require('fs').existsSync('/.dockerenv') ||
158 (require('fs').existsSync('/proc/self/cgroup') &&
159 require('fs').readFileSync('/proc/self/cgroup', 'utf8').includes('docker'));
160}
161
162const MAX_CONCURRENT_OPS = isDockerContainer() ? 100 : 50; // Higher concurrency in Docker
163

Callers 2

scan-worker.jsFile · 0.70
scanDirectoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected