1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
Olivier Wilkinson (reivilibre) c08ebafebb Newsfile
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
2019-07-30 09:14:02 +01:00
Olivier Wilkinson (reivilibre) f97c576550 Remove dead and incorrect code.
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
2019-07-30 09:14:02 +01:00
2 changed files with 8 additions and 15 deletions
+1
View File
@@ -0,0 +1 @@
Remove dead and incorrect code from room_stats.
+7 -15
View File
@@ -465,20 +465,12 @@ class StatsStore(StateDeltasStore):
self._simple_insert_txn(txn, table=table, values=values)
# actually update the new value
if stats_type in ABSOLUTE_STATS_FIELDS[stats_type]:
self._simple_update_txn(
txn,
table=table,
keyvalues={id_col: stats_id, "ts": current_ts},
updatevalues={field: value},
)
else:
sql = ("UPDATE %s SET %s=%s+? WHERE %s=? AND ts=?") % (
table,
field,
field,
id_col,
)
txn.execute(sql, (value, stats_id, current_ts))
sql = ("UPDATE %s SET %s=%s+? WHERE %s=? AND ts=?") % (
table,
field,
field,
id_col,
)
txn.execute(sql, (value, stats_id, current_ts))
return self.runInteraction("update_stats_delta", _update_stats_delta)