fix: Normalize base_time to HH:mm:ss format

HTML time input sends HH:mm, but calculateStagger expects HH:mm:ss.

Signed-off-by: Claude (Chronicler #61) <claude@firefrostgaming.com>
This commit is contained in:
Claude (Chronicler #61)
2026-04-05 10:30:36 +00:00
parent 3e4055c5dc
commit d9b54187ee

View File

@@ -141,9 +141,14 @@ router.post('/reorder-servers', async (req, res) => {
// POST /admin/scheduler/update-config - Update node config
router.post('/update-config', async (req, res) => {
try {
const { node, base_time, interval_minutes } = req.body;
let { node, base_time, interval_minutes } = req.body;
const updatedBy = req.session?.user?.username || 'Unknown';
// Normalize time to HH:mm:ss format
if (base_time && !base_time.includes(':00', 3)) {
base_time = base_time + ':00';
}
await db.query(
`UPDATE global_restart_config
SET base_time = $1, interval_minutes = $2, updated_at = NOW(), updated_by = $3