Shuffle accounts when updating all of them

This commit is contained in:
Bofh 2021-02-09 12:13:05 +01:00
parent b3103c22c5
commit 2c60e2102a
1 changed files with 3 additions and 1 deletions

View File

@ -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))