From 2c60e2102a19c19a51592e6208c426cae553c385 Mon Sep 17 00:00:00 2001 From: Bofh Date: Tue, 9 Feb 2021 12:13:05 +0100 Subject: [PATCH] Shuffle accounts when updating all of them --- igmirror.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/igmirror.py b/igmirror.py index 0b6c81d..0514021 100644 --- a/igmirror.py +++ b/igmirror.py @@ -83,7 +83,9 @@ def update_allaccounts_async(): def update_allaccounts(): # update all accounts with a timeout of 20 seconds sleeptime = int(config()['timeout_btw_accounts']) - for acc_id in os.listdir('./db/accounts'): + accounts = os.listdir('./db/accounts') + random.shuffle(accounts) + for acc_id in accounts: print('I| mirroring account "{}"...'.format(acc_id)) update_igaccount(acc_id) print('I| timeout {} seconds'.format(sleeptime))