Skip to content

Commit

Permalink
refactor: no longer use context manager
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney authored and robertbartel committed Feb 2, 2024
1 parent 595540b commit 766a374
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,8 @@ async def handle_request(self, request: ModelExecRequest, **kwargs) -> ModelExec
scheduler_message = SchedulerRequestMessage(model_request=request, user_id=session.user)
logging.debug("************* Scheduler request message ready:\n{}".format(str(scheduler_message)))
# Should be able to do this to reuse same object/context/connection across tasks, even from other methods
async with self.service_client as scheduler_client:
initial_response = await scheduler_client.async_make_request(scheduler_message)
logging.debug("************* Scheduler client received response:\n{}".format(str(initial_response)))
initial_response = await self.service_client.async_make_request(scheduler_message)
logging.debug("************* Scheduler client received response:\n{}".format(str(initial_response)))

# TODO: consider registering the job and relationship with session, etc.
success = initial_response.success
Expand Down

0 comments on commit 766a374

Please sign in to comment.