Read the statement by Michael Teeuw here.
Sleep for updatenotification loop -- Help with JS needed
-
Hi,
I’m running MM on a PiZero, which has a comparable small amount of memory and to have a long lasting SD card, I put some tmp directories in memory and disabled swap. It works fine, however, once the update process of the default updatenotification module starts, I quickly run out of memory and the browser crashes. By changing the updateinterval, I verified that it is indeed due to the updatenotification module. I think this is because all modules are checked at the same time. I’ve 10 installed modules plus the default ones. All these parallel update processes consume quite some memory.I think I found the responsible loop “for (moduleName in modules)” in MagicMirror/modules/default/updatenotification/node_helper.js
However I didn’t manage to put in some sleep command between each execution of the items in the loop. My knowledge of JS is very limited and I was not able to adapt the code examples found here https://stackoverflow.com/questions/3583724 to the MM code. I hope that somebody of you can help me with this issue.
For me a hard coded sleep time would be totally fine, but of course an official change with a parameter that can be changed in the config file (or an option, that would make the different simpleGits run one after each other) would be even better.
Already many thanks for your help!