Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#web: gunicorn api.wsgi:app --python api --log-file=-

## For debug, use below
web: gunicorn api.wsgi:app --python api --log-file=- --log-level debug --preload --workers 1
web: gunicorn api.wsgi:app --python api --log-file=- --log-level debug --preload --workers 1 --timeout 120
6 changes: 5 additions & 1 deletion services/news_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ def save_news(json):
return Message("Missing field")

cdn_dir = "ohack.dev/news"
news_image = generate_and_save_image_to_cdn(cdn_dir, json["title"])
try:
news_image = generate_and_save_image_to_cdn(cdn_dir, json["title"])
except Exception as e:
logger.exception(f"Image generation failed for title '{json['title']}': {e}")
raise
json["image"] = f"{CDN_SERVER}/{cdn_dir}/{news_image}"
json["last_updated"] = datetime.now().isoformat()
news_id = upsert_news(json)
Expand Down
Loading