hpenney2 / CatLamp

CatLamp, the all-in-one Discord bot.
MIT License
5 stars 1 forks source link

Startup sequence runs twice #16

Closed hpenney2 closed 3 years ago

hpenney2 commented 3 years ago

The startup sequence (includes import checks, upgrading packages from requirements.txt, and loading config.json) seems to run twice. This can be seen when starting the bot as the package install happens twice before the bot starts (if on the mongo branch, the MongoDB daemon check also runs twice, indicating that this applies to the entire startup sequence). This was attempted to be fixed in commit 7c1b11b88e6224e0145eb8634ad68041c1e1b9eb which removes the while True loop, however this issue still occurs. I am uncertain on what the issue is at this point in time, but it is important that this is fixed as soon as possible to optimize startup.

TheEgghead27 commented 3 years ago

Sike I got back up because I forgot to note here that this bug is caused by an import of the CatLampPY module that reruns the import checker.

hpenney2 commented 3 years ago

Sike I got back up because I forgot to note here that this bug is caused by an import of the CatLampPY module that reruns the import checker.

Basically, just need to slap it into an if __name__ == "__main__" and it'll be good.

TheEgghead27 commented 3 years ago

Yessir