Erfan commited on
Commit ·
8fd932e
1
Parent(s): 49bbcb9
fix: await fetchone in stats_summary
Browse files
db.py
CHANGED
|
@@ -122,7 +122,7 @@ async def get_all_users():
|
|
| 122 |
async def get_stats_summary():
|
| 123 |
async with aiosqlite.connect(DB_PATH) as db:
|
| 124 |
db.row_factory = aiosqlite.Row
|
| 125 |
-
total = (await db.execute("SELECT COUNT(*) as c FROM users")).fetchone()
|
| 126 |
cursor = await db.execute("SELECT action, COUNT(*) as count FROM stats GROUP BY action")
|
| 127 |
stats_rows = await cursor.fetchall()
|
| 128 |
return total, stats_rows
|
|
|
|
| 122 |
async def get_stats_summary():
|
| 123 |
async with aiosqlite.connect(DB_PATH) as db:
|
| 124 |
db.row_factory = aiosqlite.Row
|
| 125 |
+
total = await (await db.execute("SELECT COUNT(*) as c FROM users")).fetchone()
|
| 126 |
cursor = await db.execute("SELECT action, COUNT(*) as count FROM stats GROUP BY action")
|
| 127 |
stats_rows = await cursor.fetchall()
|
| 128 |
return total, stats_rows
|