import os
import gevent.socket
import redis.connection
from manage import _set_source_root_parent, _set_source_root

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

_set_source_root_parent('submodules')
_set_source_root(os.path.join('corehq', 'ex-submodules'))
_set_source_root(os.path.join('custom', '_legacy'))

redis.connection.socket = gevent.socket
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()

import os
import gevent.socket
import redis.connection
from manage import init_hq_python_path, run_patches

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

init_hq_python_path()
run_patches()

redis.connection.socket = gevent.socket
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()

Fix websockets process after celery upgrade
Fix websockets process after celery upgrade

make it do the same patching that manage.py does

  import os
  import gevent.socket
  import redis.connection
- from manage import _set_source_root_parent, _set_source_root
+ from manage import init_hq_python_path, run_patches
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
  
+ init_hq_python_path()
+ run_patches()
- _set_source_root_parent('submodules')
- _set_source_root(os.path.join('corehq', 'ex-submodules'))
- _set_source_root(os.path.join('custom', '_legacy'))
  
  redis.connection.socket = gevent.socket
  from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
  application = uWSGIWebsocketServer()
  
Fix websockets process after celery upgrade
## Code Before:
import os
import gevent.socket
import redis.connection
from manage import _set_source_root_parent, _set_source_root

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

_set_source_root_parent('submodules')
_set_source_root(os.path.join('corehq', 'ex-submodules'))
_set_source_root(os.path.join('custom', '_legacy'))

redis.connection.socket = gevent.socket
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()

## Instruction:
Fix websockets process after celery upgrade
## Code After:
import os
import gevent.socket
import redis.connection
from manage import init_hq_python_path, run_patches

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")

init_hq_python_path()
run_patches()

redis.connection.socket = gevent.socket
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()
