-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
24 lines (19 loc) · 861 Bytes
/
app.py
File metadata and controls
24 lines (19 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from chalice import Chalice
from chalicelib.venues import ComedyCellarBot, TheStandBot
from chalicelib.email_service import EmailService
from chalicelib.bot_service import ComedyBotService
from chalicelib.config import Config
app = Chalice(app_name="comedy-show-bots", debug=True)
email_service = EmailService(region_name=Config.AWS_REGION)
venues = [ComedyCellarBot(), TheStandBot()]
bot_service = ComedyBotService(venues=venues, email_service=email_service)
@app.schedule("cron(0 13 * * ? *)") # 13:00 UTC = 9 AM EDT / 8 AM EST
def check_comedy_shows(event):
print(f"Event: {event.to_dict()}")
try:
results = bot_service.check_all_venues()
bot_service.send_comedy_alerts(results)
print("Comedy show check completed successfully")
except Exception as e:
print(f"Error in comedy show check: {e}")
raise