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

Function acquirePreview3mfWorker

main.js:26–42  ·  view source on GitHub ↗
(workerPath)

Source from the content-addressed store, hash-verified

24);
25const PREVIEW_3MF_WORKER_MEMORY_MB = Math.max(
26 512,
27 Number.parseInt(process.env.PRINTVENTORY_PREVIEW_3MF_WORKER_MEMORY_MB || '2048', 10) || 2048
28);
29const PREVIEW_3MF_MAX_DISK_CACHE_MB = Math.max(
30 50,
31 Number.parseInt(process.env.PRINTVENTORY_PREVIEW_3MF_MAX_DISK_CACHE_MB || '150', 10) || 150
32);
33
34function getPreview3mfCacheDir() {
35 return path.join(app.getPath('userData'), '3mf-preview-cache');
36}
37
38function createPreview3mfWorker(workerPath) {
39 return new Worker(workerPath, {
40 resourceLimits: {
41 maxOldGenerationSizeMb: PREVIEW_3MF_WORKER_MEMORY_MB,
42 maxYoungGenerationSizeMb: Math.min(256, Math.floor(PREVIEW_3MF_WORKER_MEMORY_MB / 4))
43 }
44 });
45}

Callers 1

parse3mfPreviewHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected