diff options
| author | Adam Soltys <[email protected]> | 2022-09-05 21:08:53 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-05 21:08:53 -0700 |
| commit | 8a82c69419dc358fbaeab322c32d18ee84656feb (patch) | |
| tree | df71a4f11a16d241a38c30e6841fe199725bc7fb /lib | |
| parent | a3bcd415de65a6ae14ea451d7d1c8f3f136e99d4 (diff) | |
| download | coinos-server-8a82c69419dc358fbaeab322c32d18ee84656feb.tar.gz coinos-server-8a82c69419dc358fbaeab322c32d18ee84656feb.zip | |
missing imports and fastify err responses
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sockets.js | 6 | ||||
| -rw-r--r-- | lib/utils.js | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js index 8a5ef958..366820e0 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -1,4 +1,5 @@ import store from "./store"; +import config from "$config"; import app from "$app"; import jwt from "jsonwebtoken"; import { v4 } from "uuid"; @@ -6,6 +7,9 @@ import WebSocket from "ws"; import { differenceInSeconds, subSeconds } from "date-fns"; import fastifyWs from "@fastify/websocket"; import whitelist from "./whitelist"; +import { l, err, warn } from "$lib/logging"; +import { getUser } from "$lib/utils"; +import db from "$db"; const code = 1000; @@ -36,7 +40,7 @@ export const emit = (username, type, data) => { } if (!store.sockets[username]) return; - for (id in store.sockets[username]) { + for (let id in store.sockets[username]) { const ws = store.sockets[username][id]; ws.send(JSON.stringify({ type, data })); } diff --git a/lib/utils.js b/lib/utils.js index af50d7ec..a7db0ea3 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,3 +1,4 @@ +import db from "$db"; import sequelize from '@sequelize/core'; const { Op } = sequelize; |
