Fix duel double refund on expiry; idempotent weekly top-referrer prizes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -5662,7 +5662,7 @@ async def econ_worker(bot):
|
||||
for r in con.execute("SELECT id,challenger,units FROM duels WHERE status='expired' AND created>=? AND created<?",
|
||||
(now - 90000, now - 86400)).fetchall():
|
||||
if _persona_kv("du_ref:%d" % r["id"]) != "1":
|
||||
econ_mint(r["challenger"], r["units"], "duel:expire")
|
||||
econ_mint(r["challenger"], r["units"], "duel:expire", ref="duel:%d:expire" % r["id"]) # dedupes vs duel_expire_worker
|
||||
_persona_kv("du_ref:%d" % r["id"], "1")
|
||||
# --- [ECON-V4] недельные квесты + ачивки (авто-выплата, недельный бюджет)
|
||||
try:
|
||||
@@ -12379,7 +12379,7 @@ async def toprefs_awarder(bot):
|
||||
paid = []
|
||||
for i, rr in enumerate(rows):
|
||||
prize = TOPREF_PRIZES[i]
|
||||
got = econ_mint(int(rr["uid"]), prize * 500000, "top3week:" + wk)
|
||||
got = econ_mint(int(rr["uid"]), prize * 500000, "top3week:" + wk, ref="%d" % int(rr["uid"]))
|
||||
if got:
|
||||
paid.append((int(rr["uid"]), prize))
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user