fix: compile TypeScript in Docker build — dist/ was never built in CI, connection resilience code was missing from images
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 10m59s
Promote to Production / Deploy to Production (push) Successful in 1m15s

This commit is contained in:
OpenClaw Deployer 2026-02-18 16:19:59 +00:00
parent 95ca10175f
commit e611609580
6 changed files with 183 additions and 50 deletions

View file

@ -1,6 +1,6 @@
import { isProKey } from "../services/keys.js";
import logger from "../services/logger.js";
import pool from "../services/db.js";
import { queryWithRetry, connectWithRetry } from "../services/db.js";
const FREE_TIER_LIMIT = 100;
const PRO_TIER_LIMIT = 5000;
// In-memory cache, periodically synced to PostgreSQL
@ -17,7 +17,7 @@ function getMonthKey() {
}
export async function loadUsageData() {
try {
const result = await pool.query("SELECT key, count, month_key FROM usage");
const result = await queryWithRetry("SELECT key, count, month_key FROM usage");
usage = new Map();
for (const row of result.rows) {
usage.set(row.key, { count: row.count, monthKey: row.month_key });
@ -34,7 +34,7 @@ async function flushDirtyEntries() {
if (dirtyKeys.size === 0)
return;
const keysToFlush = [...dirtyKeys];
const client = await pool.connect();
const client = await connectWithRetry();
try {
await client.query("BEGIN");
for (const key of keysToFlush) {