Replace returnValue with return (#5736)

This commit is contained in:
Amber Brown 2019-07-23 23:00:55 +10:00 committed by GitHub
parent 18a466b84e
commit 4806651744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
177 changed files with 1359 additions and 1513 deletions

View file

@ -66,7 +66,7 @@ class StatsStore(StateDeltasStore):
if not self.stats_enabled:
yield self._end_background_update("populate_stats_createtables")
defer.returnValue(1)
return 1
# Get all the rooms that we want to process.
def _make_staging_area(txn):
@ -120,7 +120,7 @@ class StatsStore(StateDeltasStore):
self.get_earliest_token_for_room_stats.invalidate_all()
yield self._end_background_update("populate_stats_createtables")
defer.returnValue(1)
return 1
@defer.inlineCallbacks
def _populate_stats_cleanup(self, progress, batch_size):
@ -129,7 +129,7 @@ class StatsStore(StateDeltasStore):
"""
if not self.stats_enabled:
yield self._end_background_update("populate_stats_cleanup")
defer.returnValue(1)
return 1
position = yield self._simple_select_one_onecol(
TEMP_TABLE + "_position", None, "position"
@ -143,14 +143,14 @@ class StatsStore(StateDeltasStore):
yield self.runInteraction("populate_stats_cleanup", _delete_staging_area)
yield self._end_background_update("populate_stats_cleanup")
defer.returnValue(1)
return 1
@defer.inlineCallbacks
def _populate_stats_process_rooms(self, progress, batch_size):
if not self.stats_enabled:
yield self._end_background_update("populate_stats_process_rooms")
defer.returnValue(1)
return 1
# If we don't have progress filed, delete everything.
if not progress:
@ -186,7 +186,7 @@ class StatsStore(StateDeltasStore):
# No more rooms -- complete the transaction.
if not rooms_to_work_on:
yield self._end_background_update("populate_stats_process_rooms")
defer.returnValue(1)
return 1
logger.info(
"Processing the next %d rooms of %d remaining",
@ -303,9 +303,9 @@ class StatsStore(StateDeltasStore):
if processed_event_count > batch_size:
# Don't process any more rooms, we've hit our batch size.
defer.returnValue(processed_event_count)
return processed_event_count
defer.returnValue(processed_event_count)
return processed_event_count
def delete_all_stats(self):
"""