Skip to content

Commit

Permalink
WSGI handler
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoacierno committed Nov 5, 2023
1 parent 4c2a05a commit e1d8265
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backend/wsgi_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"""
Copied from: https://github.com/dougmoscrop/serverless-http
This module loads the WSGI application specified by FQN in `.serverless-wsgi` and invokes
This module loads the WSGI application specified by FQN
in `.serverless-wsgi` and invokes
the request when the handler is called by AWS Lambda.
Author: Logan Raarup <logan@logan.dk>
"""
Expand Down Expand Up @@ -31,8 +32,6 @@
SENTRY_DSN = settings.SENTRY_DSN

if SENTRY_DSN:


sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[
Expand Down Expand Up @@ -73,6 +72,14 @@ def handler(event, context):
process_sqs_messages(event)
return

if "cronEvent" in event:
logger.info("Received cronEvent from lambda")
apps.populate(settings.INSTALLED_APPS)
from association_membership.handlers import run_handler

run_handler("crons", event["name"], event["payload"])
return

"""Lambda event handler, invokes the WSGI wrapper and handles command invocation"""
if "_serverless-wsgi" in event:
import shlex
Expand Down

0 comments on commit e1d8265

Please sign in to comment.