diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-11-11 13:59:40 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-11-11 13:59:40 +0000 |
commit | 940a16119205115c02a3b23e9f3c67a08486bae0 (patch) | |
tree | 34d4eebc066d00b3fc0bfce76d35feb537129ed3 /synapse/storage/background_updates.py | |
parent | Use a background task to update databases to use the full text search (diff) | |
download | synapse-940a16119205115c02a3b23e9f3c67a08486bae0.tar.xz |
Fix the background update
Diffstat (limited to 'synapse/storage/background_updates.py')
-rw-r--r-- | synapse/storage/background_updates.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/storage/background_updates.py b/synapse/storage/background_updates.py index b6cdc6ec68..45fccc2e5e 100644 --- a/synapse/storage/background_updates.py +++ b/synapse/storage/background_updates.py @@ -93,16 +93,19 @@ class BackgroundUpdateStore(SQLBaseStore): sleep = defer.Deferred() self._background_update_timer = self._clock.call_later( - self.BACKGROUND_UPDATE_INTERVAL_MS / 1000., sleep.callback + self.BACKGROUND_UPDATE_INTERVAL_MS / 1000., sleep.callback, None ) try: yield sleep finally: self._background_update_timer = None - result = yield self.do_background_update( - self.BACKGROUND_UPDATE_DURATION_MS - ) + try: + result = yield self.do_background_update( + self.BACKGROUND_UPDATE_DURATION_MS + ) + except: + logger.exception("Error doing update") if result is None: logger.info( @@ -169,7 +172,7 @@ class BackgroundUpdateStore(SQLBaseStore): duration_ms = time_stop - time_start logger.info( - "Updating %. Updated %r items in %rms." + "Updating %r. Updated %r items in %rms." " (total_rate=%r/ms, current_rate=%r/ms, total_updated=%r)", update_name, items_updated, duration_ms, performance.total_items_per_ms(), |