Chris
02/26/2024, 8:45 AMserve_http_production(
bentotag,
working_dir=working_dir,
port=8088,
host="0.0.0.0",
api_workers=1,
reload=False,
development_mode=False,
)
After some time (e.g. 20 minutes) i want to end the serving and restart the server with a possible refreshed bento tag (e.g. new service is available for serving). Any idea how i could solve this in python (e.g. processing,...)?Jian Shen Yap
02/26/2024, 2:19 PMthreading or processing to schedule your task. may I ask what are the usecase for doing so?Chris
02/26/2024, 2:54 PMChris
02/27/2024, 8:51 AMworking_dir = "."
if os.path.isdir(os.path.expanduser(self._active_deployment)):
working_dir = os.path.expanduser(self._active_deployment)
keywords = {
'bento_identifier': self._active_deployment,
'working_dir': working_dir,
'port': 8088,
'host': "0.0.0.0",
'api_workers': 1,
'reload': False,
'development_mode': False,
}
self._inference_endpoint_process=Process(target=serve_http_production, kwargs=keywords)
self._inference_endpoint_process.start()
And End it the following way:
self._inference_endpoint_process.terminate()
self._inference_endpoint_process.join()
self._inference_endpoint_process.close()
However, the server does not stop. Any ideas?