Skip to content

Commit

Permalink
Move initializing cache to asgi.py
Browse files Browse the repository at this point in the history
See also: #17
  • Loading branch information
BECATRUE committed Dec 3, 2024
1 parent 5e87785 commit 9e2881a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions wlm_server/wlm_server/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@

from django.core.asgi import get_asgi_application
from django.urls import path
from django.conf import settings
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wlm_server.settings')

# pylint: disable=wrong-import-position
from cache.channel import ChannelCache
from operation.consumers import OperationConsumer

settings.CHANNEL_CACHE = ChannelCache()

application = ProtocolTypeRouter(
{
'http': get_asgi_application(),
Expand Down
2 changes: 0 additions & 2 deletions wlm_server/wlm_server/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wlm_server.settings')

settings.CHANNEL_CACHE = ChannelCache()

application = get_wsgi_application()

0 comments on commit 9e2881a

Please sign in to comment.