Skip to content

Commit 730f76c

Browse files
got job to execute immediately at startup instead of waiting for the interval first; increased interval to 15 minutes
1 parent e9cd388 commit 730f76c

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import os
33
import sys
4+
from datetime import datetime
45
from enum import Enum
56
from pathlib import Path
67
from flask import Flask, render_template_string, Response
@@ -57,7 +58,7 @@ def feedLobsters():
5758
return render_template_string('PageNotFound {{ errorCode }}', errorCode='404'), 404
5859

5960

60-
@scheduler.task('interval', id='scrapeJob', seconds=600, max_instances=1)
61+
@scheduler.task('interval', id='scrapeJob', seconds=900, max_instances=1, next_run_time=datetime.now())
6162
def scrapeJob():
6263
print('Executing scraping job.')
6364
hnScraper = HackerNewsScraper()

src/scrapers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
from feedgen.feed import FeedGenerator
1010
from functional import seq
1111
from stopwatch import Stopwatch
12-
1312
from models import Story, StoryType
1413
from types import SimpleNamespace
15-
1614
from dtos import RateLimitException, StoryDto
1715

1816

0 commit comments

Comments
 (0)