Configurable fetch delay

This commit is contained in:
Mint 2022-10-21 02:18:48 +03:00
parent 9a85a336ce
commit 6fa9ec72d8
2 changed files with 3 additions and 2 deletions

View file

@ -1,6 +1,7 @@
{
"site": "https://botsin.space",
"cw": null,
"fetch_delay": 1,
"learn_from_cw": false,
"ignored_cws": [],
"mention_handling": 1,
@ -14,4 +15,4 @@
"generation_mode": "markov",
"access_token": "",
"db_path": "posts.db"
}
}

View file

@ -171,7 +171,7 @@ class PostFetcher:
next_page_url = outbox['first']
while True:
sleep(1)
sleep(self.config['fetch_delay'])
print(f'Fetching {next_page_url}... ')
async with self._rl_handler.request('GET', next_page_url) as resp: page = await resp.json()