mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 17:54:48 -04:00
Migrate the user directory initial population to a background task (#4864)
This commit is contained in:
parent
651ad8bc96
commit
282c97327f
8 changed files with 405 additions and 301 deletions
|
@ -52,7 +52,9 @@ class BackgroundUpdatePerformance(object):
|
|||
Returns:
|
||||
A duration in ms as a float
|
||||
"""
|
||||
if self.total_item_count == 0:
|
||||
if self.avg_duration_ms == 0:
|
||||
return 0
|
||||
elif self.total_item_count == 0:
|
||||
return None
|
||||
else:
|
||||
# Use the exponential moving average so that we can adapt to
|
||||
|
@ -64,7 +66,9 @@ class BackgroundUpdatePerformance(object):
|
|||
Returns:
|
||||
A duration in ms as a float
|
||||
"""
|
||||
if self.total_item_count == 0:
|
||||
if self.total_duration_ms == 0:
|
||||
return 0
|
||||
elif self.total_item_count == 0:
|
||||
return None
|
||||
else:
|
||||
return float(self.total_item_count) / float(self.total_duration_ms)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue