fix sleep from seconds to minutes

This commit is contained in:
2024-05-26 03:32:20 -05:00
parent fcb17394c6
commit 4bb7c15277

View File

@@ -118,7 +118,7 @@ def check_reddit(config):
# Debug message # Debug message
current_time = datetime.datetime.now() current_time = datetime.datetime.now()
print_and_flush(f'Starting search at: {current_time.strftime("%Y-%m-%d %H:%M:%S")}') print_and_flush(f'Starting search at: {current_time.strftime("%Y-%m-%d %H:%M:%S")}')
resp = requests.get(f'https://www.reddit.com/r/{subreddit}/new.json', headers=http_headers) resp = requests.get(f'https://www.reddit.com/r/{subreddit}/new.json', headers=http_headers)
if resp.status_code == 200: if resp.status_code == 200:
@@ -146,7 +146,7 @@ def check_reddit(config):
# Send alert # Send alert
send_alert(config, title, text, url, timestamp, keyword) send_alert(config, title, text, url, timestamp, keyword)
time.sleep(config.get('interval')) time.sleep(config.get('interval') * 60)
# Send alert out # Send alert out
def send_alert(config, title, text, url, timestamp, keyword): def send_alert(config, title, text, url, timestamp, keyword):