Skip to content

Commit

Permalink
feat: add spec path parameter on bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaffad committed Jan 15, 2023
1 parent 7a61fa6 commit 99d8ad4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ async def startup():
init_logger(settings.log_level)

logger = logging.getLogger(__name__)
# TODO: custom process injection
app.state.bootstrap: Bootstrap = await bootstrap(
custom_functions={"springhead/dummy": custom_process_logger}
) # type: ignore
Expand Down
6 changes: 3 additions & 3 deletions springhead/core/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from dataclasses import dataclass
from typing import Callable, Dict, List

from pydantic import FilePath
from statefun import Context, Message, RequestReplyHandler, ValueSpec

from springhead.models import Pipeline, Process
Expand All @@ -20,12 +21,11 @@ class Bootstrap:


async def bootstrap(
specification_path: FilePath = "./app/specifications.yml", # type: ignore
custom_functions: Dict[str, Callable[[Context, Message, Process], None]] = dict(),
custom_value_specs: Dict[str, List[ValueSpec]] = dict(),
) -> Bootstrap:
specification_builder = SpecificationBuilder(
"./app/specifications.yml"
) # type: ignore
specification_builder = SpecificationBuilder(specification_path) # type: ignore
specifications = specification_builder.read_spec_file()
processes: List[Process] = []
for specification in specifications:
Expand Down

0 comments on commit 99d8ad4

Please sign in to comment.