Topic: Bug(?): "RangeError: Maximum call stack size exceeded"
Hi Mr. Popov,
with EG 2.34 I am regularly getting this error:
..:: Express Generator v2.34 ::..
Market : Unknown GBPJPY H1
From : 1986-12-19 14:00, To: 2017-03-21 00:00, Bars: 189249
Spread : 12, Swap long: 15, Swap short: -17.2, Commission: 11 USD
Account: 100000 USD, Leverage: 500, Entry: 1 lots
Generator started...
- Ascended: 5, Calculated: 15279, Opt: 5, Time: 18:00, Coll: 5
Collection exported: ./collections/Unknown_GBPJPY_H1_2017-03-21_str_5_(5172).json
- Ascended: 10, Calculated: 30019, Opt: 10, Time: 30:54, Coll: 5
Collection exported: ./collections/Unknown_GBPJPY_H1_2017-03-21_str_5_(5195).json
RangeError: Maximum call stack size exceeded, Time: 51:45, Coll: 5
at existsSync (node:fs:300:1)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:321:10)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
at addSuffixToJsonFile (C:\PortablePrograms\ExpressGenerator\bin\lib\collection.js:329:16)
I think it happens if there are a lot of collection files in the destination directory already (5000+) and it has to cycle through a loop to find the next free number. This can happen if EG runs for a long time and I hope you can fix it to still be able to handle that amount of files (and much more if its running unattended for weeks).
Please also see https://stackoverflow.com/questions/209 … e-exceeded (in case it helps anything).
Thanks for the fix in advance.