summaryrefslogtreecommitdiff
path: root/src/leap/soledad/server/entrypoints.py
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-11-13 21:55:57 -0200
committerdrebs <drebs@riseup.net>2017-11-14 19:01:15 -0200
commit201ef7a9b979f8c8efaedbe542c631944d8956f4 (patch)
tree8a1dda362017234c46930aaa3e7ecfa1984d0922 /src/leap/soledad/server/entrypoints.py
parent129f14dd59abf24f6f0801ee256dc5909850bc20 (diff)
[bug] wait for checks before running servers
Diffstat (limited to 'src/leap/soledad/server/entrypoints.py')
-rw-r--r--src/leap/soledad/server/entrypoints.py30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/leap/soledad/server/entrypoints.py b/src/leap/soledad/server/entrypoints.py
index fa8c3ff2..0237978e 100644
--- a/src/leap/soledad/server/entrypoints.py
+++ b/src/leap/soledad/server/entrypoints.py
@@ -17,20 +17,14 @@
"""
Entrypoints for the Soledad server.
"""
-import os
-
from twisted.internet import reactor
-from twisted.python import threadpool
from twisted.logger import Logger
+from twisted.python import threadpool
-from ..common.couch.state import check_schema_versions
from .auth import localPortal, publicPortal
from .session import SoledadSession
-from ._config import get_config
-from ._wsgi import init_couch_state
-conf = get_config()
log = Logger()
@@ -49,25 +43,3 @@ class ServicesEntrypoint(SoledadSession):
def __init__(self):
portal = localPortal()
SoledadSession.__init__(self, portal)
-
-
-def check_conf():
- path = conf['blobs_path']
- blobs_not_empty = bool(os.path.exists(path) and os.listdir(path))
- if not conf['blobs'] and blobs_not_empty:
- message = """
-** WARNING: Blobs is disabled, but blobs directory isn't empty. **
-** If it was previously enabled, disabling can cause data loss due blobs **
-** documents not being accessible to users. **
-** Blobs directory: %s
-** REFUSING TO START. Please double check your configuration. **
- """
- log.error(message % path)
- reactor.stop()
-
-
-reactor.callWhenRunning(check_conf)
-reactor.callWhenRunning(check_schema_versions, conf['couch_url'])
-# see the comments in _wsgi.py regarding why couch state has to be
-# initialized when the reactor is running
-reactor.callWhenRunning(init_couch_state, conf)