1
0
Fork 0
forked from bioeb_org/ub4tg

fix counter rebased victims

This commit is contained in:
Your Name 2024-12-18 22:34:36 +03:00
parent f1c00107a9
commit aeb46ec681

View file

@ -92,19 +92,17 @@ async def bio_backup_stealing(client, c, conn, default_directory):
else:
rejected += 1
conn.commit()
logger.success('backup success stealed')
if cmd == 'me':
my_victims_ids = tuple(my_victims_ids)
result = c.execute(
f'UPDATE avocado SET expr_int = 0 WHERE user_id NOT IN {my_victims_ids}').fetchall()
c.execute(f'UPDATE avocado SET expr_int = 0 WHERE user_id NOT IN {my_victims_ids}')
rebased = c.rowcount
conn.commit()
logger.success('database rebased')
logger.success('backup success stealed')
del my_victims_ids
del victims # free memory
del raw_victims
if cmd == 'me':
rebased = len(result)
await event.edit(f'Success added/updated {added} patients\nOther {rebased} patients reset to 0')
del result
await event.edit(f'Success added/updated {added} patients\nOther {rebased} patients marked as not infected')
else:
await event.edit(f'Success added {added} new patients\nRejected or exists: {rejected}')