Skip to content

scan multiple demos for kills of one player #390

Answered by saul
danielstoeck asked this question in Questions
Discussion options

You must be logged in to vote

The issue is that you are running out of memory because you are trying to read 1,200 demos at the same time (in parallel).

parseStream is not a synchronous function. It will immediately return and process the stream asynchronously. You're likely better off running through the demos one by one to ensure you don't run out of memory. One way to do this would be to await a promise that resolves when the demo has finished parsing. See below for an example:

const testFolderPath = "/Volumes/Backup/biggie-demos/";
const fs = require("fs");
const path = require("path");
const demofile = require("demofile");

for (let tempFile of fs.readdirSync(testFolderPath)) {
  await new Promise((resolve, reject) 

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@danielstoeck
Comment options

Comment options

You must be logged in to vote
1 reply
@danielstoeck
Comment options

Answer selected by saul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants