Add PostgreSQL production backend to eliminate SQLite lock contention.

Support DATABASE_URL with connection pooling, pg_dump backups, SQLite migration script, and deploy_postgres.sh with docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:11:42 +08:00
parent 39eac983ff
commit 52aca456e9
23 changed files with 1208 additions and 150 deletions
+7 -2
View File
@@ -859,8 +859,13 @@
equityEl.textContent = fmtMoney(data.capital);
}
var rows = positionRows(data);
if (!rows.length && data.sync_state === 'syncing' && lastPosRows.length) {
rows = lastPosRows;
if (!rows.length && lastPosRows.length) {
var keepSticky = data.sync_state === 'syncing'
|| Number(data.margin_used) > 0
|| (data.risk_status && Number(data.risk_status.active_count) > 0);
if (keepSticky) {
rows = lastPosRows;
}
}
var sig = rows.map(function (r) {
var key = r.key || r.position_key || ((r.symbol_code || '') + ':' + (r.direction || ''));