Browse Source

Make timeout_btw_accounts configurable

master
Bofh 10 months ago
parent
commit
b3103c22c5
  1. 3
      config.json.example
  2. 5
      igmirror.py

3
config.json.example

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

5
igmirror.py

@ -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…
Cancel
Save