Skip to content

Commit

Permalink
[WEKAPP-476559] adding callback on blpop in wait
Browse files Browse the repository at this point in the history
  • Loading branch information
YonatanAbirWeka committed Jan 27, 2025
1 parent 6e6bd3f commit 9dec154
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions talker/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
TalkerClientSendTimeout, TalkerServerTimeout, ClientCommandTimeoutError, CommandTimeoutError,
CommandAbortedByReboot, CommandAbortedByOverflow, CommandOrphaned,
CommandLineTimeout, CommandExecutionError, UnknownExitCode, TalkerError, CommandPidTimeoutError, CommandAlreadyDone,
HostIsNotResponsive
HostIsNotResponsive,NoResponseForRedisCommand
)


Expand Down Expand Up @@ -613,9 +613,12 @@ def wait(self, for_ack=False):

if self.alive_check:
blpop_timeout = min(blpop_timeout, self.alive_check_interval)

result = self.talker.reactor.blpop(
[self._exit_code_key, self._ack_key], timeout=blpop_timeout, _cmd_id=self.job_id)
try:
result = self.talker.reactor.blpop(
[self._exit_code_key, self._ack_key], timeout=blpop_timeout, _cmd_id=self.job_id, _callback=self.on_sent)
except NoResponseForRedisCommand as e:
if self.is_sent:
raise e
if result is None:
self.check_client_timeout()

Expand Down

0 comments on commit 9dec154

Please sign in to comment.