feat: simplify OTA updates with timestamp

This commit is contained in:
2026-07-11 10:50:00 +08:00
parent bc5fe471ab
commit b0361fc366
6 changed files with 102 additions and 44 deletions
+3
View File
@@ -189,6 +189,9 @@ router.put('/config', async (req, res) => {
if (typeof incoming.force_update === 'boolean') {
cfg.force_update = incoming.force_update;
}
if (incoming.update_timestamp) {
cfg.update_timestamp = incoming.update_timestamp;
}
await DataService.saveConfig(cfg);
appendReqLog(req, { category: 'admin', type: 'update_config_generic', detail: incoming });
io.emit('config:updated', cfg);
+2 -1
View File
@@ -229,7 +229,8 @@ router.get('/config', (req, res) => {
res.json({
promotion: { name: cfg.promotion?.name || '', discount: cfg.promotion?.discount ?? 1 },
lua_versions: cfg.lua_versions || {},
force_update: cfg.force_update === true
force_update: cfg.force_update === true,
update_timestamp: cfg.update_timestamp || 0
});
});