mirror of https://github.com/zulip/zulip.git
ruff: Fix B012 return inside finally blocks.
return inside finally blocks causes exceptions to be silenced. Although these blocks follow blanket ‘except Exception’ handlers, they do not seem to have a goal of silencing BaseException and exceptions thrown by the exception handler, so rewrite them to avoid it. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
c4e5ddd67f
commit
1735b8863e
|
@ -339,11 +339,11 @@ class QueueProcessingWorker(ABC):
|
|||
# especially since the queue might go idle until new events come in.
|
||||
self.update_statistics()
|
||||
self.idle = True
|
||||
return
|
||||
|
||||
else:
|
||||
self.consume_iteration_counter += 1
|
||||
if (
|
||||
self.consume_iteration_counter >= self.CONSUME_ITERATIONS_BEFORE_UPDATE_STATS_NUM
|
||||
self.consume_iteration_counter
|
||||
>= self.CONSUME_ITERATIONS_BEFORE_UPDATE_STATS_NUM
|
||||
or time.time() - self.last_statistics_update_time
|
||||
>= self.MAX_SECONDS_BEFORE_UPDATE_STATS
|
||||
):
|
||||
|
|
Loading…
Reference in New Issue