mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 01:21:09 +03:00
pep8
This commit is contained in:
parent
7285afa4be
commit
8743f42b49
3 changed files with 7 additions and 5 deletions
|
@ -51,7 +51,7 @@ class RegistrationConfig(Config):
|
|||
|
||||
self.replicate_user_profiles_to = config.get("replicate_user_profiles_to", [])
|
||||
if not isinstance(self.replicate_user_profiles_to, list):
|
||||
self.replicate_user_profiles_to = [self.replicate_user_profiles_to,]
|
||||
self.replicate_user_profiles_to = [self.replicate_user_profiles_to, ]
|
||||
|
||||
def default_config(self, **kwargs):
|
||||
registration_shared_secret = random_string_with_symbols(50)
|
||||
|
|
|
@ -83,7 +83,7 @@ class ProfileHandler(BaseHandler):
|
|||
try:
|
||||
for i in xrange(host_batches[repl_host] + 1, latest_batch + 1):
|
||||
yield self._replicate_host_profile_batch(repl_host, i)
|
||||
except:
|
||||
except Exception:
|
||||
logger.exception(
|
||||
"Exception while replicating to %s: aborting for now", repl_host,
|
||||
)
|
||||
|
@ -110,7 +110,7 @@ class ProfileHandler(BaseHandler):
|
|||
yield self.http_client.post_json_get_json(url, signed_body)
|
||||
self.store.update_replication_batch_for_host(host, batchnum)
|
||||
logger.info("Sucessfully replicated profile batch %d to %s", batchnum, host)
|
||||
except:
|
||||
except Exception:
|
||||
# This will get retried when the looping call next comes around
|
||||
logger.exception("Failed to replicate profile batch %d to %s", batchnum, host)
|
||||
raise
|
||||
|
|
|
@ -71,7 +71,9 @@ class ProfileWorkerStore(SQLBaseStore):
|
|||
txn.execute("SELECT MAX(batch) as maxbatch FROM profiles")
|
||||
rows = self.cursor_to_dict(txn)
|
||||
return rows[0]['maxbatch']
|
||||
max_batch = yield self.runInteraction("get_latest_profile_replication_batch_number", f)
|
||||
max_batch = yield self.runInteraction(
|
||||
"get_latest_profile_replication_batch_number", f,
|
||||
)
|
||||
defer.returnValue(max_batch)
|
||||
|
||||
def get_profile_batch(self, batchnum):
|
||||
|
@ -104,7 +106,7 @@ class ProfileWorkerStore(SQLBaseStore):
|
|||
def f(txn):
|
||||
txn.execute("SELECT host, last_synced_batch FROM profile_replication_status")
|
||||
rows = self.cursor_to_dict(txn)
|
||||
return { r['host']: r['last_synced_batch'] for r in rows }
|
||||
return {r['host']: r['last_synced_batch'] for r in rows}
|
||||
result = yield self.runInteraction("get_replication_hosts", f)
|
||||
defer.returnValue(result)
|
||||
|
||||
|
|
Loading…
Reference in a new issue