Closed 3urobeat closed 3 years ago
This isn't as easy as I thought. I have decided to not use a child_process because I don't want to bother with input & output stuff and potential cross-platform issues.
The solution which I now added isn't perfect but should hopefully work for this use case just fine. I modified the original setInterval() function to add the calling interval to an array first before then calling the stock setInterval function.
This allows me to then clear all intervals referenced in that array in the restart function.
Let's hope this solves this and any potential other and yet undiscovered issues similar to this one.
Fixed in 560e130 (Version 2.10.6).
Describe the bug The restart function in
start.js
doesn't terminate the old bot "session" (dunno if that is the best term to describe it with) correctly and can cause the bot basically running twice. Since the accounts in the old "session" are logged off correctly when an update is applied no issues will be noticed until the old "session" tries to update again because it still has the old version number cached.After the old "session" updated the bot and restarts itself again, the bot will crash because of a fatal LogonSessionReplaced error on startup.
Additional context Clearing the cache is not enough, maybe start using a childprocess,