Skip to content

Commit

Permalink
service.legacy: merge db con param from config, args and defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
deeenes committed Jan 28, 2025
1 parent 3cf5d39 commit 49735ad
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion omnipath_server/service/_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,6 @@ def __init__(

_log('Creating LegacyService.')

self.con = _connection.ensure_con(con)

# self.input_files = copy.deepcopy(self.default_input_files)
# self.input_files.update(input_files or {})
Expand All @@ -764,6 +763,28 @@ def __init__(
# _log(f'{self.__class__.__name__} startup ready.')


def _connect(
self,
con: _connection.Connection | dict | None = None,
) -> None:

con = con or {}

if isinstance(con, dict):

con = {
f'legacy_db_{param}':
session.config.get(
param,
override = con.get(param, None),
default = default,
)
for param, default in _connection.DEFAULTS
}

self.con = _connection.ensure_con(con)


def _read_tables(self):

_log('Loading data tables.')
Expand Down

0 comments on commit 49735ad

Please sign in to comment.