reduce one time disk I/O when url changed.

master
Max 2023-08-03 15:23:35 +08:00 committed by GitHub
parent 5c690d03a1
commit 2c2b47855b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -11088,15 +11088,19 @@ def main(args):
if len(url) == 0: if len(url) == 0:
continue continue
is_maxbot_paused = False
if os.path.exists(CONST_MAXBOT_INT28_FILE):
is_maxbot_paused = True
if len(url) > 0 : if len(url) > 0 :
if url != last_url: if url != last_url:
print(url) print(url)
write_last_url_to_file(url) write_last_url_to_file(url)
if os.path.exists(CONST_MAXBOT_INT28_FILE): if is_maxbot_paused:
print("MAXBOT Paused.") print("MAXBOT Paused.")
last_url = url last_url = url
if os.path.exists(CONST_MAXBOT_INT28_FILE): if is_maxbot_paused:
time.sleep(0.2) time.sleep(0.2)
continue continue