Move setting up of storage into init/__init__.py
Factoring out this one should be the last one needed to rewrite the celery setup. The idea is to not setup the whole app, but just call a bunch of individual setup_* functions and be done.
This commit is contained in:
@@ -23,6 +23,7 @@ from mediagoblin.mg_globals import setup_globals
|
||||
from mediagoblin.db.open import setup_connection_and_db_from_config
|
||||
from mediagoblin.db.util import MigrationManager
|
||||
from mediagoblin.workbench import WorkbenchManager
|
||||
from mediagoblin.storage import storage_system_from_config
|
||||
|
||||
|
||||
class Error(Exception): pass
|
||||
@@ -103,6 +104,19 @@ def get_staticdirector(app_config):
|
||||
"direct_remote_paths must be provided")
|
||||
|
||||
|
||||
def setup_storage():
|
||||
app_config = mg_globals.app_config
|
||||
|
||||
public_store = storage_system_from_config(app_config, 'publicstore')
|
||||
queue_store = storage_system_from_config(app_config, 'queuestore')
|
||||
|
||||
setup_globals(
|
||||
public_store = public_store,
|
||||
queue_store = queue_store)
|
||||
|
||||
return public_store, queue_store
|
||||
|
||||
|
||||
def setup_workbench():
|
||||
app_config = mg_globals.app_config
|
||||
|
||||
|
||||
Reference in New Issue
Block a user