Skip to content

Commit c930487

Browse files
committed
Update main.py to initialize logging and the database connection
1 parent cf7e8b2 commit c930487

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

main.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14-
14+
import typer
15+
from nwastdlib.logging import initialise_logging
16+
from orchestrator import app_settings
1517
from orchestrator.cli.main import app as core_cli
18+
from orchestrator.db import init_database
19+
from orchestrator.log_config import LOGGER_OVERRIDES
20+
21+
22+
def init_cli_app() -> typer.Typer:
23+
initialise_logging(LOGGER_OVERRIDES)
24+
init_database(app_settings)
25+
return core_cli()
1626

1727

1828
if __name__ == "__main__":
19-
core_cli()
29+
init_cli_app()

0 commit comments

Comments
 (0)