Send badge count pushes.

Also fix bugs with retrying.
This commit is contained in:
David Baker 2016-04-07 15:39:53 +01:00
parent 0fd1cd2400
commit 92e3071623
4 changed files with 71 additions and 24 deletions

View file

@ -390,16 +390,19 @@ class ReceiptsStore(SQLBaseStore):
}
)
def get_all_updated_receipts(self, last_id, current_id, limit):
def get_all_updated_receipts(self, last_id, current_id, limit=None):
def get_all_updated_receipts_txn(txn):
sql = (
"SELECT stream_id, room_id, receipt_type, user_id, event_id, data"
" FROM receipts_linearized"
" WHERE ? < stream_id AND stream_id <= ?"
" ORDER BY stream_id ASC"
" LIMIT ?"
)
txn.execute(sql, (last_id, current_id, limit))
args = [last_id, current_id]
if limit is not None:
sql += " LIMIT ?"
args.append(limit)
txn.execute(sql, args)
return txn.fetchall()
return self.runInteraction(