Skip to content

Commit

Permalink
Add on_app_init to litestar config
Browse files Browse the repository at this point in the history
  • Loading branch information
insani7y committed Sep 2, 2024
1 parent 5da0c0b commit 02610a8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion microbootstrap/bootstrappers/litestar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import litestar.types
import typing_extensions
from litestar import openapi
from litestar.config.app import AppConfig as LitestarConfig
from litestar.config.cors import CORSConfig as LitestarCorsConfig
from litestar.contrib.opentelemetry.config import OpenTelemetryConfig as LitestarOpentelemetryConfig
from litestar.contrib.prometheus import PrometheusConfig as LitestarPrometheusConfig
Expand All @@ -14,6 +13,7 @@
from sentry_sdk.integrations.litestar import LitestarIntegration

from microbootstrap.bootstrappers.base import ApplicationBootstrapper
from microbootstrap.config.litestar import LitestarConfig
from microbootstrap.instruments.cors_instrument import CorsInstrument
from microbootstrap.instruments.logging_instrument import LoggingInstrument
from microbootstrap.instruments.opentelemetry_instrument import OpentelemetryInstrument
Expand Down
Empty file.
14 changes: 14 additions & 0 deletions microbootstrap/config/litestar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from __future__ import annotations
import dataclasses
import typing

from litestar.config.app import AppConfig


if typing.TYPE_CHECKING:
from litestar.types import OnAppInitHandler


@dataclasses.dataclass
class LitestarConfig(AppConfig):
on_app_init: typing.Sequence[OnAppInitHandler] | None = None
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
version = "0.2.4"
version = "0.2.5"
description = "Package for bootstrapping new micro-services"
authors = ["community-of-python"]
readme = "README.md"
Expand Down

0 comments on commit 02610a8

Please sign in to comment.