Skip to content

Commit

Permalink
use config to create the storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Delaunay committed Jun 6, 2022
1 parent f9fb609 commit 508a6a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/orion/storage/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def get_storage():
with the appropriate arguments for the chosen backend
"""
return storage_factory.create()
return setup_storage()


def setup_storage(storage=None, debug=False):
Expand Down Expand Up @@ -576,7 +576,7 @@ def setup_storage(storage=None, debug=False):

log.debug("Creating %s storage client with args: %s", storage_type, storage)
try:
storage_factory.create(of_type=storage_type, **storage)
return storage_factory.create(of_type=storage_type, **storage)
except ValueError:
if storage_factory.create().__class__.__name__.lower() != storage_type.lower():
raise
Expand Down
4 changes: 2 additions & 2 deletions src/orion/storage/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_database():
with the appropriate arguments for the chosen backend
"""
return database_factory.create()
return setup_database()


def setup_database(config=None):
Expand Down Expand Up @@ -91,7 +91,7 @@ def __init__(self, database=None, setup=True):
if database is not None:
setup_database(database)

self._db = database_factory.create()
self._db = setup_database()

if setup:
self._setup_db()
Expand Down

0 comments on commit 508a6a3

Please sign in to comment.