mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-19 22:54:17 -05:00
Review comments
Use iteritems over item to loop over dict formatting
This commit is contained in:
parent
b4e37c6f50
commit
0e5f479fc0
@ -426,7 +426,7 @@ def run(hs):
|
|||||||
stats["daily_messages"] = yield hs.get_datastore().count_daily_messages()
|
stats["daily_messages"] = yield hs.get_datastore().count_daily_messages()
|
||||||
|
|
||||||
r30_results = yield hs.get_datastore().count_r30_users()
|
r30_results = yield hs.get_datastore().count_r30_users()
|
||||||
for name, count in r30_results.items():
|
for name, count in r30_results.iteritems():
|
||||||
stats["r30_users_" + name] = count
|
stats["r30_users_" + name] = count
|
||||||
|
|
||||||
daily_sent_messages = yield hs.get_datastore().count_daily_sent_messages()
|
daily_sent_messages = yield hs.get_datastore().count_daily_sent_messages()
|
||||||
|
@ -280,8 +280,9 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||||||
|
|
||||||
sql = """
|
sql = """
|
||||||
SELECT platform, COALESCE(count(*), 0) FROM (
|
SELECT platform, COALESCE(count(*), 0) FROM (
|
||||||
SELECT users.name, platform, users.creation_ts * 1000,
|
SELECT
|
||||||
MAX(uip.last_seen)
|
users.name, platform, users.creation_ts * 1000,
|
||||||
|
MAX(uip.last_seen)
|
||||||
FROM users
|
FROM users
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
@ -310,8 +311,8 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||||||
results = {}
|
results = {}
|
||||||
txn.execute(sql, (thirty_days_ago_in_secs,
|
txn.execute(sql, (thirty_days_ago_in_secs,
|
||||||
thirty_days_ago_in_secs))
|
thirty_days_ago_in_secs))
|
||||||
rows = txn.fetchall()
|
|
||||||
for row in rows:
|
for row in txn:
|
||||||
if row[0] is 'unknown':
|
if row[0] is 'unknown':
|
||||||
pass
|
pass
|
||||||
results[row[0]] = row[1]
|
results[row[0]] = row[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user