Revert previous 'fix' and discard any conflicting possibilities.

This commit is contained in:
Vgr E.Barry 2015-02-22 20:18:24 -05:00
parent 05e3ecd68f
commit e691f918c8

View File

@ -993,8 +993,7 @@ def toggle_altpinged_status(nick, value, old=None):
var.PING_IF_NUMS[old].remove(cloak)
def join_timer_handler(cli):
var.WARNING_LOCK.acquire() # need to do this instead of the context manager
with var.WARNING_LOCK:
var.PINGING_IFS = True
to_ping = []
pl = var.list_players()
@ -1021,7 +1020,6 @@ def join_timer_handler(cli):
if not chk_acc and not checker:
var.PINGING_IFS = False
var.WARNING_LOCK.release()
return
@hook("whospcrpl", hookid=387)
@ -1048,14 +1046,11 @@ def join_timer_handler(cli):
# this is one of the multiple reasons we need unit testing
# I was lucky to catch this in testing, as it requires precise timing
# it only failed if a join happened while this outer func had started
# possible underlying bugs were squashed with the proper use of a reentrant lock
del var.TIMERS['join_pinger']
var.PINGING_IFS = False
decorators.unhook(HOOKS, 387)
if to_ping:
to_ping.sort(key=lambda x: x.lower())
cli.msg(botconfig.CHANNEL, "PING! {0} players! {1}".format(len(pl), " ".join(to_ping)))
var.WARNING_LOCK.release()
cli.who(botconfig.CHANNEL, "%nushaf")