codesandboxer
codesandboxer copied to clipboard
Repeated usage of `assembleFiles` API eventually causes `tooManyModules`
We're using codesandboxer within docz and it runs assembleFiles over and over in a single Node process. There's a global counter in loadFiles that increments each time it's run, and after you invoke it 120 times it starts throwing { key: 'tooManyModules' }.
I think it makes sense to check that a single sandbox doesn't contain too many modules, but the count variable should probably be passed as an argument and incremented as loadFiles is called recursively so that the counter isn't global?
This sounds absolutely correct, this shouldn't be a global.