Commit be7e66fc authored by Andrea Suisani's avatar Andrea Suisani
Browse files

Merge branch 'hotfix/nft-unpack-thread-flags' into 'main'

Start the NFT unpacking thread without the parent's node flags

Worker threads inherit process.execArgv, and some flags (e.g. --input-type) stop a file-based worker from starting, so every NFT lost its files. The thread now starts with execArgv: [] and keeps its own resourceLimits.

See merge request !340
parents 3cba67e8 4f57c9af
Loading
Loading
Loading
Loading
+1
Changes for app/utils.js: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -1456,6 +1456,7 @@ async function loadNFTData(zipData, providerName) {
			worker = new Worker(new URL('./nftZip.js', import.meta.url), {
				workerData: { nftZip: true, zipData, providerName },
				resourceLimits: { maxOldGenerationSizeMb: 512, maxYoungGenerationSizeMb: 64 },
				execArgv: [], // don't inherit the parent's node flags (e.g. --input-type breaks a file worker)
			});
			deadline = setTimeout(() => reject(new Error("timed out")), 60000);
			worker.once('message', (msg) => msg.error ? reject(new Error(msg.error)) : resolve(msg.result));