Revert previous 'fix' and discard any conflicting possibilities.
This commit is contained in:
parent
05e3ecd68f
commit
e691f918c8
@ -993,8 +993,7 @@ def toggle_altpinged_status(nick, value, old=None):
|
|||||||
var.PING_IF_NUMS[old].remove(cloak)
|
var.PING_IF_NUMS[old].remove(cloak)
|
||||||
|
|
||||||
def join_timer_handler(cli):
|
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
|
var.PINGING_IFS = True
|
||||||
to_ping = []
|
to_ping = []
|
||||||
pl = var.list_players()
|
pl = var.list_players()
|
||||||
@ -1021,7 +1020,6 @@ def join_timer_handler(cli):
|
|||||||
|
|
||||||
if not chk_acc and not checker:
|
if not chk_acc and not checker:
|
||||||
var.PINGING_IFS = False
|
var.PINGING_IFS = False
|
||||||
var.WARNING_LOCK.release()
|
|
||||||
return
|
return
|
||||||
|
|
||||||
@hook("whospcrpl", hookid=387)
|
@hook("whospcrpl", hookid=387)
|
||||||
@ -1048,14 +1046,11 @@ def join_timer_handler(cli):
|
|||||||
# this is one of the multiple reasons we need unit testing
|
# this is one of the multiple reasons we need unit testing
|
||||||
# I was lucky to catch this in testing, as it requires precise timing
|
# 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
|
# 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
|
var.PINGING_IFS = False
|
||||||
decorators.unhook(HOOKS, 387)
|
decorators.unhook(HOOKS, 387)
|
||||||
if to_ping:
|
if to_ping:
|
||||||
to_ping.sort(key=lambda x: x.lower())
|
to_ping.sort(key=lambda x: x.lower())
|
||||||
cli.msg(botconfig.CHANNEL, "PING! {0} players! {1}".format(len(pl), " ".join(to_ping)))
|
cli.msg(botconfig.CHANNEL, "PING! {0} players! {1}".format(len(pl), " ".join(to_ping)))
|
||||||
var.WARNING_LOCK.release()
|
|
||||||
|
|
||||||
cli.who(botconfig.CHANNEL, "%nushaf")
|
cli.who(botconfig.CHANNEL, "%nushaf")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user