th3-z / kf2-magicked-admin

:spider: Mutator-free management, statistics, and in-game bot for ranked Killing Floor 2 servers
https://kf2-ma.th3-z.xyz
MIT License
32 stars 7 forks source link

[BUG] SIGINT Handling #122

Closed th3-z closed 4 years ago

th3-z commented 4 years ago

Describe the bug 0.1.5 Currently has a bug where it can take up to 5mins to fully terminate on SIGINT. This is because of the motd_updater's main loop. 0.1.4 Never terminates on SIGINT with motd_updater enabled.

To Reproduce Steps to reproduce the behavior:

  1. Start KF2 Magicked Admin with motd_updater enabled
  2. Press ctrl+c
  3. The program does not terminate properly

Expected behavior KF2 Magicked Admin should take a split second to write the database before closing when receiving SIGINT.

Solution motd_updater needs to regularly check for the __exit flag, not once per update. Add timer for motd updates, sleep thread for 1s per iteration.

Desktop (please complete the following information):

Server (please complete the following information):

th3-z commented 4 years ago

Should be fixed in 0.1.5