feat: decouple OTA updates into dedicated fast endpoints to avoid db timeouts

This commit is contained in:
2026-07-11 12:22:48 +08:00
parent bd6ef05722
commit 79ae234232
4 changed files with 26 additions and 12 deletions
+2 -5
View File
@@ -1483,12 +1483,9 @@ createApp({
isPushingUpdate.value = true;
// 每次点击,更新计数器 +1,终端只要看到计数器变大就会更新
config.update_counter = (config.update_counter || 0) + 1;
config.force_update = true;
try {
await requestJson('/api/config', { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(config) }, { expectOk: true });
// 直接请求专门的轻量级触发更新接口,避免和庞大的配置文件保存混在一起导致超时
await requestJson('/api/trigger-update', { method: 'POST' }, { expectOk: true });
alert('推送指令发送完毕,终端将陆续更新');
} catch (err) {
console.error(err);