mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:34:51 -04:00
Fix a bug in background updates wherein background updates are never run using the default batch size (#12157)
This commit is contained in:
parent
f63bedef07
commit
26211fec24
4 changed files with 16 additions and 15 deletions
|
@ -102,10 +102,12 @@ class BackgroundUpdatePerformance:
|
|||
Returns:
|
||||
A duration in ms as a float
|
||||
"""
|
||||
if self.avg_duration_ms == 0:
|
||||
return 0
|
||||
elif self.total_item_count == 0:
|
||||
# We want to return None if this is the first background update item
|
||||
if self.total_item_count == 0:
|
||||
return None
|
||||
# Avoid dividing by zero
|
||||
elif self.avg_duration_ms == 0:
|
||||
return 0
|
||||
else:
|
||||
# Use the exponential moving average so that we can adapt to
|
||||
# changes in how long the update process takes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue