Skip to content

Commit

Permalink
refactor: call extend rest interface in worker (#6108)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanFM authored Nov 15, 2023
1 parent 6c6ff28 commit dbe8a94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions jina/serve/runtimes/worker/request_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ def call_handle(request):
]

return self.process_single_data(request, None, is_generator=is_generator)

app = get_fastapi_app(
request_models_map=request_models_map, caller=call_handle, **kwargs
)
Expand All @@ -187,7 +186,9 @@ def call_handle(request):
async def _shutdown():
await self.close()

return app
from jina.helper import extend_rest_interface

return extend_rest_interface(app)

def _http_fastapi_sagemaker_app(self, **kwargs):
from jina.serve.runtimes.worker.http_sagemaker_app import get_fastapi_app
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_log_level(monkeypatch):


@pytest.fixture(autouse=True)
def test_grpc_fork_support_false(monkeypatch):
def test_grpc_fork_support_true(monkeypatch):
monkeypatch.setenv('GRPC_ENABLE_FORK_SUPPORT', 'true')


Expand Down Expand Up @@ -94,4 +94,4 @@ def set_test_pip_version() -> None:
os.environ['JINA_GATEWAY_IMAGE'] = 'jinaai/jina:test-pip'
yield
if 'JINA_GATEWAY_IMAGE' in os.environ: # maybe another fixture has already removed
del os.environ['JINA_GATEWAY_IMAGE']
del os.environ['JINA_GATEWAY_IMAGE']

0 comments on commit dbe8a94

Please sign in to comment.