fix sleep from seconds to minutes
This commit is contained in:
4
main.py
4
main.py
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user