From aeb46ec681b6ad7d51c93d675a655472e72a5d8e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Dec 2024 22:34:36 +0300 Subject: [PATCH] fix counter rebased victims --- src/victimsbackup.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/victimsbackup.py b/src/victimsbackup.py index a1e646d..11b6432 100644 --- a/src/victimsbackup.py +++ b/src/victimsbackup.py @@ -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}')