Add long_polling_jobs to API (#78)

This commit is contained in:
2024-02-13 13:11:56 -06:00
committed by GitHub
parent ecf836c235
commit a0729d71f1
2 changed files with 22 additions and 6 deletions

View File

@@ -126,8 +126,9 @@ class RenderServerProxy:
self.__update_job_cache(timeout, ignore_token)
return self.__jobs_cache.copy() if self.__jobs_cache else None
def __update_job_cache(self, timeout=5, ignore_token=False):
url = f'jobs?token={self.__jobs_cache_token}' if self.__jobs_cache_token and not ignore_token else 'jobs'
def __update_job_cache(self, timeout=30, ignore_token=False):
url = f'jobs_long_poll?token={self.__jobs_cache_token}' if (self.__jobs_cache_token and
not ignore_token) else 'jobs'
status_result = self.request_data(url, timeout=timeout)
if status_result is not None:
sorted_jobs = []