diff options
author | Andrej Shadura <andrewsh@debian.org> | 2019-11-26 20:46:31 +0100 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2019-11-26 20:46:31 +0100 |
commit | 45de6f998a2b81ab0c55aa9f42ebf86fa046a29c (patch) | |
tree | 9328d0cf74bf1a8aeeb01d31887ae5fca838ac4a /synapse/storage/_base.py | |
parent | c3e687e74cf69e8b60c663af1cd7a8817cbd1c82 (diff) |
New upstream version 1.6.0
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r-- | synapse/storage/_base.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index f5906fcd..ab596fa6 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -361,14 +361,11 @@ class SQLBaseStore(object): expiration_ts, ) - self._simple_insert_txn( + self._simple_upsert_txn( txn, "account_validity", - values={ - "user_id": user_id, - "expiration_ts_ms": expiration_ts, - "email_sent": False, - }, + keyvalues={"user_id": user_id}, + values={"expiration_ts_ms": expiration_ts, "email_sent": False}, ) def start_profiling(self): @@ -494,7 +491,7 @@ class SQLBaseStore(object): exception_callbacks = [] if LoggingContext.current_context() == LoggingContext.sentinel: - logger.warn("Starting db txn '%s' from sentinel context", desc) + logger.warning("Starting db txn '%s' from sentinel context", desc) try: result = yield self.runWithConnection( @@ -532,7 +529,7 @@ class SQLBaseStore(object): """ parent_context = LoggingContext.current_context() if parent_context == LoggingContext.sentinel: - logger.warn( + logger.warning( "Starting db connection from sentinel context: metrics will be lost" ) parent_context = None @@ -719,7 +716,7 @@ class SQLBaseStore(object): raise # presumably we raced with another transaction: let's retry. - logger.warn( + logger.warning( "IntegrityError when upserting into %s; retrying: %s", table, e ) |