Skip to content

Commit

Permalink
doc fixed and one silly error also fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jan 23, 2025
1 parent 9317cb1 commit 1441814
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chatsky/context_storages/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ def _lock(function: Callable[..., Awaitable[Any]]):
@wraps(function)
async def wrapped(self: DBContextStorage, *args, **kwargs):
if not self.connected:
logger.warning("Initializing ContextStorage in-place, that is NOT thread-safe, dangerous and in general should be avoided!")
self.connect()
logger.warning(
"Initializing ContextStorage in-place, that is NOT thread-safe and in general should be avoided!"
)
await self.connect()
if not self.is_concurrent:
async with self._sync_lock:
return await function(self, *args, **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions chatsky/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ async def _run_pipeline(
def run(self):
"""
Method that starts a pipeline and connects to :py:attr:`messenger_interface`.
It also connects to the :py:attr:`context_storage` (if it's not already connected).
It passes :py:meth:`_run_pipeline` to :py:attr:`messenger_interface` as a callback,
so every time user request is received, :py:meth:`_run_pipeline` will be called.
Expand All @@ -288,6 +289,7 @@ def __call__(
Method that executes pipeline once.
Basically, it is a shortcut for :py:meth:`_run_pipeline`.
NB! When pipeline is executed this way, :py:attr:`messenger_interface` won't be initiated nor connected.
Still, it connects to the :py:attr:`context_storage` (if it's not already connected) to avoid sync issues.
This method has the same signature as :py:class:`~chatsky.core.service.types.PipelineRunnerFunction`.
"""
Expand Down

0 comments on commit 1441814

Please sign in to comment.