feat: use simpler update_counter instead of timestamp for OTA updates
This commit is contained in:
@@ -164,7 +164,7 @@ router.get('/config', (req, res) => {
|
||||
promotion: cfg.promotion || { name: '', discount: 1 },
|
||||
lua_versions: cfg.lua_versions || {},
|
||||
force_update: cfg.force_update === true,
|
||||
update_timestamp: cfg.update_timestamp || 0
|
||||
update_counter: cfg.update_counter || 0
|
||||
});
|
||||
});
|
||||
|
||||
@@ -190,8 +190,8 @@ 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;
|
||||
if (incoming.update_counter) {
|
||||
cfg.update_counter = incoming.update_counter;
|
||||
}
|
||||
await DataService.saveConfig(cfg);
|
||||
appendReqLog(req, { category: 'admin', type: 'update_config_generic', detail: incoming });
|
||||
|
||||
Reference in New Issue
Block a user