aboutsummaryrefslogtreecommitdiffstats
path: root/lib/migrate.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-29 10:11:25 +0000
committerAdam Soltys <[email protected]>2023-12-29 10:12:10 +0000
commitc474dbb763480ec923cd49f5cac0e07a310552a7 (patch)
tree7376dece597eaea7999e732f83b44cfdfe521c1c /lib/migrate.js
parent46522875683db9123f8a6fe9746a5c5db6f1638e (diff)
downloadcoinos-server-c474dbb763480ec923cd49f5cac0e07a310552a7.tar.gz
coinos-server-c474dbb763480ec923cd49f5cac0e07a310552a7.zip
error handling
Diffstat (limited to 'lib/migrate.js')
-rw-r--r--lib/migrate.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/migrate.js b/lib/migrate.js
index 20d26325..87e7ab60 100644
--- a/lib/migrate.js
+++ b/lib/migrate.js
@@ -1,4 +1,4 @@
-import { err } from "$lib/logging";
+import { err, l } from "$lib/logging";
import { types } from "$lib/payments";
import { archive, db, g } from "$lib/db";
@@ -15,6 +15,7 @@ async function migrate(id) {
if (user) {
let { username } = user;
username = username.replace(/\s/g, "").toLowerCase();
+ l("migrating", username);
let multi = await db
.multi()
.set(`user:${username}`, id)
@@ -59,7 +60,11 @@ async function migrate(id) {
}),
);
- await multi.exec();
+ try {
+ await multi.exec();
+ } catch (e) {
+ warn("failed to migrate", username);
+ }
delete q[id];