Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Engine: Use atomic.LoadInt32/AddInt32 for starting/stopping the database subsystem #412
Originally it was possible to crash the bot by sending two subsequent stop requests to the database subsystem (via the cli or an app) due to attempting to close and already closed channel. This method protects the bot when stopping the database subsystem (sets the state to stopping, preventing further stop requests) until the state is finally reset when it does actually shutdown.
Type of change
How has this been tested
@@ Coverage Diff @@ ## master #412 +/- ## ========================================== + Coverage 40.97% 40.98% +<.01% ========================================== Files 162 162 Lines 38575 38579 +4 ========================================== + Hits 15807 15810 +3 + Misses 21639 21638 -1 - Partials 1129 1131 +2