diff --git a/src/khoj/app/asgi.py b/src/khoj/app/asgi.py new file mode 100644 index 00000000..d0709b5b --- /dev/null +++ b/src/khoj/app/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for app project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "khoj.app.settings") + +application = get_asgi_application() diff --git a/src/khoj/app/settings.py b/src/khoj/app/settings.py index a46e83f9..349e48ae 100644 --- a/src/khoj/app/settings.py +++ b/src/khoj/app/settings.py @@ -108,7 +108,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = "app.wsgi.application" +ASGI_APPLICATION = "app.asgi.application" # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases diff --git a/src/khoj/app/wsgi.py b/src/khoj/app/wsgi.py deleted file mode 100644 index 03956936..00000000 --- a/src/khoj/app/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for app project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "khoj.app.settings") - -application = get_wsgi_application() diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 548f2fe9..dc33586b 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -328,7 +328,7 @@ def update_content_index_regularly(): ) -@schedule.repeat(schedule.every(1).to(2).hours) +@schedule.repeat(schedule.every(30).to(59).minutes) def close_all_db_connections(): from django import db