0.4.0b4 register.ts does not need DATABASE_URL

This commit is contained in:
Yusur 2026-02-25 12:13:30 +01:00
parent ff6e132ab4
commit f71c7b0e34
3 changed files with 7 additions and 4 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "sknsybot", "name": "sknsybot",
"version": "0.4.0.b3", "version": "0.4.0.b4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "sknsybot", "name": "sknsybot",
"version": "0.4.0.b3", "version": "0.4.0.b4",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"chalk": "^5.4.1", "chalk": "^5.4.1",

View file

@ -1,6 +1,6 @@
{ {
"name": "sknsybot", "name": "sknsybot",
"version": "0.4.0.b3", "version": "0.4.0.b4",
"private": true, "private": true,
"description": "", "description": "",
"license": "Apache-2.0", "license": "Apache-2.0",

View file

@ -4,7 +4,10 @@ import * as schema from "./schema";
import { Pool } from "pg"; import { Pool } from "pg";
function urlToObj(url: string) { function urlToObj(url: string) {
if (!url) throw new Error('DATABASE_URL is not set'); if (!url) {
console.warn("DATABASE_URL is not set, expect the database to not connect");
return null;
}
const { username, password, hostname, port, pathname } = URL.parse(url); const { username, password, hostname, port, pathname } = URL.parse(url);