Merge pull request #17 from brrr2/reaper-lag

One more fix for issue #4.
This commit is contained in:
nyuszika7h 2014-03-22 12:13:39 +01:00
commit 87b6861b08

View File

@ -829,6 +829,9 @@ def stop_game(cli, winner = ""):
reset_modes_timers(cli) reset_modes_timers(cli)
# Set temporary phase to deal with disk lag
var.PHASE = "writing files"
plrl = [] plrl = []
for role,ppl in var.ORIGINAL_ROLES.items(): for role,ppl in var.ORIGINAL_ROLES.items():
for x in ppl: for x in ppl:
@ -1023,6 +1026,9 @@ def reaper(cli, gameid):
while gameid == var.GAME_ID: while gameid == var.GAME_ID:
with var.GRAVEYARD_LOCK: 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 if var.WARN_IDLE_TIME or var.KILL_IDLE_TIME: # only if enabled
to_warn = [] to_warn = []
to_kill = [] to_kill = []