mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-22 09:24:39 -04:00
Run database check before daemonizing, at the cost of database hygiene.
This commit is contained in:
parent
f8152f2708
commit
b02e1006b9
3 changed files with 18 additions and 27 deletions
|
@ -421,3 +421,13 @@ def prepare_sqlite3_database(db_conn):
|
|||
" VALUES (?,?)",
|
||||
(row[0], False)
|
||||
)
|
||||
|
||||
|
||||
def are_all_users_on_domain(txn, domain):
|
||||
sql = "SELECT COUNT(*) FROM users WHERE name NOT LIKE ?"
|
||||
pat = "%:" + domain
|
||||
cursor = txn.execute(sql, (pat,))
|
||||
num_not_matching = cursor.fetchall()[0][0]
|
||||
if num_not_matching == 0:
|
||||
return True
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue