UPD: initial architecture
CI / quality (push) Has been cancelled

This commit is contained in:
Uklonil
2026-07-27 10:23:50 +02:00
parent 63fc0e6771
commit 3aeaed0af2
108 changed files with 11103 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
const postgres = require("postgres");
const databaseUrl = process.env.DATABASE_URL;
if (!databaseUrl) throw new Error("DATABASE_URL is required.");
const client = postgres(databaseUrl, { max: 1 });
(async () => {
for (let attempt = 1; attempt <= 30; attempt += 1) {
try {
await client`select 1`;
await client.end();
return;
} catch {
if (attempt === 30) {
await client.end();
throw new Error("Database was not reachable after 30 attempts.");
}
await new Promise((resolve) => setTimeout(resolve, 1000));
}
}
})().catch((error) => {
console.error("Database wait failed", error);
process.exit(1);
});