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
3 changes: 3 additions & 0 deletions contentcuration/contentcuration/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ class ContentConfig(AppConfig):
name = 'contentcuration'

def ready(self):
# Import signals
import contentcuration.signals # noqa

if settings.AWS_AUTO_CREATE_BUCKET and not is_gcs_backend():
from contentcuration.utils.minio_utils import ensure_storage_bucket_public
ensure_storage_bucket_public()
14 changes: 14 additions & 0 deletions contentcuration/contentcuration/signals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from django.db.backends.signals import connection_created
from django.dispatch import receiver


@receiver(connection_created)
def set_jit(sender, connection, **kwargs):
"""
Disable Just-In-Time compilation for PostgreSQL databases, at least until we can
optimize its use.
https://www.postgresql.org/docs/12/runtime-config-query.html#GUC-JIT
"""
if connection.vendor == 'postgresql':
with connection.cursor() as cursor:
cursor.execute("SET jit = 'off';")