Skip to content

Commit

Permalink
Misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
radupotop committed Apr 15, 2024
1 parent cebe9aa commit e6254ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/backend/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from app.backend.config import ConfigReader
from app.backend.db import init_db

# Cannot use api.init() here due to circular deps with Storage.
cfg = ConfigReader()


Expand Down
3 changes: 3 additions & 0 deletions app/backend/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def __init__(self, db: Database):
db.connect(reuse_if_open=True)

def get_db(self) -> Database:
"""
Get the active db.
"""
return self.conn

def _today(self) -> datetime:
Expand Down
6 changes: 3 additions & 3 deletions app/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def create_db(db: Database):
db.close()


def create_chains(cfg, ipt):
def create_chains(ipt, cfg):
ipt.setup_whitelist_chain()
ipt.setup_input_chain(set_policy_drop=cfg.set_input_policy_drop)


if __name__ == '__main__':
storage, ipt, cfg = init()
create_db(storage.conn)
create_chains(cfg, ipt)
create_db(storage.get_db())
create_chains(ipt, cfg)

0 comments on commit e6254ee

Please sign in to comment.