Also increase the time between visits to a search engine to two seconds

This commit is contained in:
Kovid Goyal 2022-07-31 09:09:31 +05:30
parent a7662ea9b1
commit 3e05244ae9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -32,7 +32,7 @@ Result = namedtuple('Result', 'url title cached_url')
@contextmanager @contextmanager
def rate_limit(name='test', time_between_visits=1, max_wait_seconds=5 * 60, sleep_time=0.2): def rate_limit(name='test', time_between_visits=2, max_wait_seconds=5 * 60, sleep_time=0.2):
lock_file = os.path.join(cache_dir(), 'search-engines.' + name + '.lock') lock_file = os.path.join(cache_dir(), 'search-engines.' + name + '.lock')
with ExclusiveFile(lock_file, timeout=max_wait_seconds, sleep_time=sleep_time) as f: with ExclusiveFile(lock_file, timeout=max_wait_seconds, sleep_time=sleep_time) as f:
try: try: