Skip to content

Commit

Permalink
fix: use unbound method to link to dry_run endpoint (#6143)
Browse files Browse the repository at this point in the history
Signed-off-by: Joan Martinez <[email protected]>
Co-authored-by: Jina Dev Bot <[email protected]>
  • Loading branch information
JoanFM and jina-bot authored Feb 23, 2024
1 parent 7fbbfcf commit af406ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions jina/serve/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ def __init__(
if __dry_run_endpoint__ not in self.requests:
self.requests[
__dry_run_endpoint__
] = _FunctionWithSchema.get_function_with_schema(self._dry_run_func)
] = _FunctionWithSchema.get_function_with_schema(
self.__class__._dry_run_func
)
else:
self.logger.warning(
f' Endpoint {__dry_run_endpoint__} is defined by the Executor. Be aware that this endpoint is usually reserved to enable health checks from the Client through the gateway.'
Expand All @@ -409,7 +411,9 @@ def __init__(
if type(self) == BaseExecutor:
self.requests[
__default_endpoint__
] = _FunctionWithSchema.get_function_with_schema(self._dry_run_func)
] = _FunctionWithSchema.get_function_with_schema(
self.__class__._dry_run_func
)

self._lock = contextlib.AsyncExitStack()
try:
Expand Down
2 changes: 1 addition & 1 deletion jina/serve/executors/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pathlib import Path
from typing import Callable, Dict, List, Optional, Sequence, Type, Union

from jina._docarray import Document, DocumentArray, docarray_v2
from jina._docarray import Document, DocumentArray
from jina.constants import __cache_path__
from jina.helper import is_generator, iscoroutinefunction
from jina.importer import ImportExtensions
Expand Down

0 comments on commit af406ce

Please sign in to comment.