Clean up some code in the retry logic (#6017)

* remove some unused code
* make things which were constants into constants for efficiency and clarity
This commit is contained in:
Richard van der Hoff 2019-09-11 15:14:56 +01:00 committed by GitHub
parent 9c555f37e3
commit 7902bf1e1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 36 deletions

View file

@ -250,26 +250,6 @@ class TransactionStore(SQLBaseStore):
},
)
def get_destinations_needing_retry(self):
"""Get all destinations which are due a retry for sending a transaction.
Returns:
list: A list of dicts
"""
return self.runInteraction(
"get_destinations_needing_retry", self._get_destinations_needing_retry
)
def _get_destinations_needing_retry(self, txn):
query = (
"SELECT * FROM destinations"
" WHERE retry_last_ts > 0 and retry_next_ts < ?"
)
txn.execute(query, (self._clock.time_msec(),))
return self.cursor_to_dict(txn)
def _start_cleanup_transactions(self):
return run_as_background_process(
"cleanup_transactions", self._cleanup_transactions