Files
dwroller/database/healthcheck.js
Alex b47065edbf Moves GM player management to PlayerTab
Centralizes all GM controls—add, update, delete player, set RP or renown, reset player passwords—into the PlayerTab for a more intuitive workflow. Removes GM panel logic and duplication from the shop view, clarifies GM access, and improves error feedback on player list loading. Adds a backend health check endpoint and minor UI polish.
2025-08-15 11:12:49 +02:00

22 lines
607 B
JavaScript

// Simple healthcheck script for local use and systemd
// Exit code 0 = OK, non-zero = failure
const { playerHelpers, db } = require('./sqlite-db');
async function run() {
try {
const players = playerHelpers.getAll();
console.log(`Players count: ${players.length}`);
// optional: print first few names
console.log(players.slice(0, 10).map(p => p.name));
// Close DB and exit 0
db.close();
process.exit(0);
} catch (err) {
console.error('Healthcheck failed:', err && err.message ? err.message : err);
try { db.close(); } catch(e){}
process.exit(2);
}
}
run();