mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-27 03:19:24 -05:00
Merge pull request #6092 from matrix-org/babolivier/background_update_deactivated_return
Fix the return value in the users_set_deactivated_flag background job
This commit is contained in:
commit
f99a9c9cb0
1
changelog.d/6092.bugfix
Normal file
1
changelog.d/6092.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix the logged number of updated items for the users_set_deactivated_flag background update.
|
@ -218,7 +218,7 @@ class BackgroundUpdateStore(SQLBaseStore):
|
|||||||
duration_ms = time_stop - time_start
|
duration_ms = time_stop - time_start
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"Updating %r. Updated %r items in %rms."
|
"Running background update %r. Processed %r items in %rms."
|
||||||
" (total_rate=%r/ms, current_rate=%r/ms, total_updated=%r, batch_size=%r)",
|
" (total_rate=%r/ms, current_rate=%r/ms, total_updated=%r, batch_size=%r)",
|
||||||
update_name,
|
update_name,
|
||||||
items_updated,
|
items_updated,
|
||||||
|
@ -865,7 +865,7 @@ class RegistrationStore(
|
|||||||
rows = self.cursor_to_dict(txn)
|
rows = self.cursor_to_dict(txn)
|
||||||
|
|
||||||
if not rows:
|
if not rows:
|
||||||
return True
|
return True, 0
|
||||||
|
|
||||||
rows_processed_nb = 0
|
rows_processed_nb = 0
|
||||||
|
|
||||||
@ -881,18 +881,18 @@ class RegistrationStore(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if batch_size > len(rows):
|
if batch_size > len(rows):
|
||||||
return True
|
return True, len(rows)
|
||||||
else:
|
else:
|
||||||
return False
|
return False, len(rows)
|
||||||
|
|
||||||
end = yield self.runInteraction(
|
end, nb_processed = yield self.runInteraction(
|
||||||
"users_set_deactivated_flag", _background_update_set_deactivated_flag_txn
|
"users_set_deactivated_flag", _background_update_set_deactivated_flag_txn
|
||||||
)
|
)
|
||||||
|
|
||||||
if end:
|
if end:
|
||||||
yield self._end_background_update("users_set_deactivated_flag")
|
yield self._end_background_update("users_set_deactivated_flag")
|
||||||
|
|
||||||
return batch_size
|
return nb_processed
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def add_access_token_to_user(self, user_id, token, device_id, valid_until_ms):
|
def add_access_token_to_user(self, user_id, token, device_id, valid_until_ms):
|
||||||
|
Loading…
Reference in New Issue
Block a user