完成虎牙宝典WSS绑定与快照隔离重构

This commit is contained in:
yml2213
2026-09-01 12:40:22 +08:00
parent 24f312a3a9
commit 26514b332d
11 changed files with 181 additions and 24 deletions
+11 -2
View File
@@ -310,10 +310,15 @@ class RechargeMixin:
}
goods.append(item)
worker_db.query(HuyaRechargeGoodsSnapshot).delete(synchronize_session=False)
worker_db.query(HuyaRechargeGoodsSnapshot).filter(
HuyaRechargeGoodsSnapshot.account_id == account.id,
HuyaRechargeGoodsSnapshot.sid == (self._to_int(config_info.get("sid")) or 2203),
).delete(synchronize_session=False)
for item in goods:
worker_db.add(
HuyaRechargeGoodsSnapshot(
account_id=account.id,
sid=self._to_int(config_info.get("sid")) or 2203,
spu_id=item["spu_id"],
sku_id=item["sku_id"],
name=item["name"],
@@ -382,7 +387,11 @@ class RechargeMixin:
snapshot = (
worker_db.query(HuyaRechargeGoodsSnapshot)
.filter(HuyaRechargeGoodsSnapshot.spu_id == spu_id)
.filter(
HuyaRechargeGoodsSnapshot.account_id == account.id,
HuyaRechargeGoodsSnapshot.sid == (self._to_int(config_info.get("sid")) or 2203),
HuyaRechargeGoodsSnapshot.spu_id == spu_id,
)
.first()
)
payload_sku_id = self._to_int(self.payload.get("sku_id"))