Skip to content

Commit

Permalink
refactor: minor cleanup of unused settings arg in BasePersistentStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Nov 27, 2023
1 parent a7b0719 commit 3892e13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions silverback/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from taskiq import TaskiqResult
from typing_extensions import Self # Introduced 3.11

from .types import IntOrNone, ISilverbackSettings, SilverbackIdent
from .types import IntOrNone, SilverbackIdent

_HandlerReturnType = TypeVar("_HandlerReturnType")

Expand Down Expand Up @@ -53,9 +53,6 @@ def from_taskiq(


class BasePersistentStorage(ABC):
def __init__(self, settings: ISilverbackSettings):
self.settings = settings

@abstractmethod
async def init(self):
"""Handle any async initialization from Silverback settings (e.g. migrations)."""
Expand Down
2 changes: 1 addition & 1 deletion silverback/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_persistent_storage(self) -> Optional[BasePersistentStorage]:
return None

persistence_class = import_from_string(self.PERSISTENCE_CLASS)
return persistence_class(self)
return persistence_class()

def get_provider_context(self) -> ProviderContextManager:
return self.network_manager.parse_network_choice(self.get_network_choice())
Expand Down

0 comments on commit 3892e13

Please sign in to comment.