fix:优化pm2配置项
This commit is contained in:
@@ -183,6 +183,23 @@ def merge(extracted: Dict[str, Any], db_path: Optional[str] = None) -> bool:
|
||||
updated = True
|
||||
except Exception:
|
||||
pass
|
||||
# force_summary 增量:导弹消耗(看板「导弹消耗」「导弹库存」由 force_summary 提供)
|
||||
if "force_summary_delta" in extracted:
|
||||
for side, delta in extracted["force_summary_delta"].items():
|
||||
if side not in ("us", "iran"):
|
||||
continue
|
||||
mc = delta.get("missile_consumed")
|
||||
if mc is not None and isinstance(mc, (int, float)) and mc > 0:
|
||||
mc = min(int(mc), 500)
|
||||
try:
|
||||
cur = conn.execute(
|
||||
"UPDATE force_summary SET missile_consumed = missile_consumed + ?, missile_stock = max(0, missile_stock - ?) WHERE side = ?",
|
||||
(mc, mc, side),
|
||||
)
|
||||
if cur.rowcount > 0:
|
||||
updated = True
|
||||
except Exception:
|
||||
pass
|
||||
# retaliation
|
||||
if "retaliation" in extracted:
|
||||
r = extracted["retaliation"]
|
||||
|
||||
Reference in New Issue
Block a user