Skip to content

Commit

Permalink
Merge branch 'release/2.7.0-alpha.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamDumpleton committed Mar 7, 2024
2 parents beb689a + 2af6b73 commit 2dad5c5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
15 changes: 6 additions & 9 deletions session-manager/handlers/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ def send_event_to_webhook(url, message):


def report_analytics_event(event, data={}):
message = None

logging.info("Reporting analytics event %s with data %s.", event, data)

if not ANALYTICS_WEBHOOK_URL:
return

message = {
"event": {
"name": event,
Expand All @@ -36,5 +29,9 @@ def report_analytics_event(event, data={}):
},
}

if message:
send_event_to_webhook(ANALYTICS_WEBHOOK_URL, message)
logging.info("Reporting analytics event %s as message %s.", event, message)

if not ANALYTICS_WEBHOOK_URL:
return

send_event_to_webhook(ANALYTICS_WEBHOOK_URL, message)
11 changes: 6 additions & 5 deletions training-portal/src/project/apps/workshops/manager/analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ def send_event_to_webhook(url, message):
def report_analytics_event(entity, event, data={}):
message = None

logging.info("Reporting analytics event %s with data %s.", event, data)

if not settings.ANALYTICS_WEBHOOK_URL:
return

if event.startswith("User/"):
user = entity

Expand Down Expand Up @@ -85,5 +80,11 @@ def report_analytics_event(entity, event, data={}):
},
}

if message:
logging.info("Reporting analytics event %s as message %s.", event, message)

if not settings.ANALYTICS_WEBHOOK_URL:
return

if message:
send_event_to_webhook(settings.ANALYTICS_WEBHOOK_URL, message).schedule()
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ def session_terminate(request, name):
@login_required(login_url="/")
@require_http_methods(["GET"])
@resources_lock
@transaction.atomic
def session_delete(request, name):
"""Triggers deletion of a workshop session."""

Expand Down
3 changes: 3 additions & 0 deletions training-portal/src/project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(DATA_DIR, "db.sqlite3"),
"OPTIONS": {
"timeout": 15,
}
}
}

Expand Down

0 comments on commit 2dad5c5

Please sign in to comment.