workers.storagereplication: error on LocalStorage
Ensure we don't start when LocalStorage is in the config. Fixes #502
This commit is contained in:
parent
601b741c4e
commit
03f5fe6143
1 changed files with 15 additions and 2 deletions
|
@ -75,8 +75,21 @@ class StorageReplicationWorker(QueueWorker):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if not features.STORAGE_REPLICATION:
|
logging.config.fileConfig('conf/logging.conf', disable_existing_loggers=False)
|
||||||
logger.debug('Full storage replication disabled; skipping')
|
|
||||||
|
has_local_storage = False
|
||||||
|
|
||||||
|
if features.STORAGE_REPLICATION:
|
||||||
|
for storage_type, _ in app.config.get('DISTRIBUTED_STORAGE_CONFIG', {}).values():
|
||||||
|
if storage_type == 'LocalStorage':
|
||||||
|
has_local_storage = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not features.STORAGE_REPLICATION or has_local_storage:
|
||||||
|
if has_local_storage:
|
||||||
|
logger.error("Storage replication can't be used with local storage")
|
||||||
|
else:
|
||||||
|
logger.debug('Full storage replication disabled; skipping')
|
||||||
while True:
|
while True:
|
||||||
time.sleep(10000)
|
time.sleep(10000)
|
||||||
|
|
||||||
|
|
Reference in a new issue