changing the interval to 5 min + add a try except to the email sending method
This commit is contained in:
parent
2a092e1eb2
commit
9486225e8b
2 changed files with 7 additions and 3 deletions
2
app.py
2
app.py
|
@ -27,7 +27,7 @@ class App:
|
||||||
self.scheduler.init_app(self.app)
|
self.scheduler.init_app(self.app)
|
||||||
self.scheduler.start()
|
self.scheduler.start()
|
||||||
# Schedule the job
|
# Schedule the job
|
||||||
self.scheduler.add_job(id='notifyUpcommingEvents', func=self.notifyUpcommingEvents, trigger='interval', minutes=30)
|
self.scheduler.add_job(id='notifyUpcommingEvents', func=self.notifyUpcommingEvents, trigger='interval', minutes=5)
|
||||||
print("Scheduler started")
|
print("Scheduler started")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,11 @@ class EventNotifyerService:
|
||||||
|
|
||||||
|
|
||||||
def notify_user(userEmail, event):
|
def notify_user(userEmail, event):
|
||||||
# send email to user is the email been sent, return true; otherwise, return false
|
try:
|
||||||
|
print("User:", userEmail, "Event:", event)
|
||||||
return True
|
return True
|
||||||
|
except:
|
||||||
|
print("Error printing user and event")
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue