mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-09 03:22:57 +01:00
Change to use logger in db upgrade script
This commit is contained in:
parent
640e53935d
commit
b4c38738f4
1 changed files with 4 additions and 1 deletions
|
@ -1,11 +1,14 @@
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def run_upgrade(cur):
|
def run_upgrade(cur):
|
||||||
cur.execute("SELECT id, regex FROM application_services_regex")
|
cur.execute("SELECT id, regex FROM application_services_regex")
|
||||||
for row in cur.fetchall():
|
for row in cur.fetchall():
|
||||||
try:
|
try:
|
||||||
print "checking %s..." % row[0]
|
logger.debug("Checking %s..." % row[0])
|
||||||
json.loads(row[1])
|
json.loads(row[1])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# row isn't in json, make it so.
|
# row isn't in json, make it so.
|
||||||
|
|
Loading…
Reference in a new issue