From 4d6a3dc71f6e10ad6d738fe59a4f1d8d2f5b854a Mon Sep 17 00:00:00 2001 From: Yizhe Shen Date: Sat, 22 Mar 2014 01:21:27 -0400 Subject: [PATCH] One more fix for issue #4. Fix to ensure that the reapertimer thread terminates when the game ends even if disk lag is encountered. This should be the final fix required for issue #4. --- modules/wolfgame.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 622aaf6..7817d11 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -829,6 +829,9 @@ def stop_game(cli, winner = ""): reset_modes_timers(cli) + # Set temporary phase to deal with disk lag + var.PHASE = "writing files" + plrl = [] for role,ppl in var.ORIGINAL_ROLES.items(): for x in ppl: @@ -1023,6 +1026,9 @@ def reaper(cli, gameid): while gameid == var.GAME_ID: with var.GRAVEYARD_LOCK: + # Terminate reaper when experiencing disk lag + if var.PHASE == "writing files": + return if var.WARN_IDLE_TIME or var.KILL_IDLE_TIME: # only if enabled to_warn = [] to_kill = []