implement automated job scraping scheduler with retry logic and logging
This commit is contained in:
12
main.py
12
main.py
@@ -4,8 +4,20 @@ starts webserver
|
||||
"""
|
||||
|
||||
import web.app as app
|
||||
import threading
|
||||
from web.craigslist import start_scheduler
|
||||
|
||||
|
||||
def start_background_scheduler():
|
||||
"""Start the scheduler in a background thread."""
|
||||
scheduler_thread = threading.Thread(target=start_scheduler, daemon=True)
|
||||
scheduler_thread.start()
|
||||
print("Background scheduler started")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# Start scheduler in background thread
|
||||
start_background_scheduler()
|
||||
|
||||
# start web server
|
||||
app.main()
|
||||
|
||||
Reference in New Issue
Block a user