diff options
| author | John Barratt <[email protected]> | 2023-02-28 12:20:10 -0800 |
|---|---|---|
| committer | John Barratt <[email protected]> | 2023-02-28 12:20:10 -0800 |
| commit | 58e996a4ac227162f171e84530fe898cb504e045 (patch) | |
| tree | ebc59d724acfcca6298bddb540811b7413d15980 /lib/db.js | |
| parent | 6f5ffb59b83fb57546c46df6a610b8efaf1252cf (diff) | |
| download | coinos-server-58e996a4ac227162f171e84530fe898cb504e045.tar.gz coinos-server-58e996a4ac227162f171e84530fe898cb504e045.zip | |
add db connect try catch and commit before pull
Diffstat (limited to 'lib/db.js')
| -rw-r--r-- | lib/db.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3,7 +3,12 @@ import { sleep } from "$lib/utils"; import { createClient } from "redis"; export const db = createClient({ url: config.db }); -await db.connect(); +try { + await db.connect(); + console.log("CONNECTED") +} catch (e) { + console.log("FAILED CONNECTION") +} export default db; export let g = async k => { |
