Make timeout_btw_accounts configurable
This commit is contained in:
parent
02a59cc385
commit
b3103c22c5
|
@ -6,6 +6,9 @@
|
|||
// maximum video size in MB (depends MAX_PHOTO_SIZE Pixelfed)
|
||||
"max_video_size": 30,
|
||||
|
||||
// time to sleep between account updates
|
||||
"timeout_btw_accounts": 20,
|
||||
|
||||
// time to sleep between posts successfull updates
|
||||
"timeout_btw_posts": 0
|
||||
}
|
||||
|
|
|
@ -82,11 +82,12 @@ 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'):
|
||||
print('I| mirroring account "{}"...'.format(acc_id))
|
||||
update_igaccount(acc_id)
|
||||
print('I| timeout 20 seconds')
|
||||
time.sleep(20)
|
||||
print('I| timeout {} seconds'.format(sleeptime))
|
||||
time.sleep(sleeptime)
|
||||
print()
|
||||
print('I| done updating all accounts')
|
||||
|
||||
|
|
Loading…
Reference in New Issue