Serverproxy manager (#61)

* Create serverproxy_manager.py

* Replace use of direct RenderServerProxy with ServerProxyManager method
This commit is contained in:
2023-11-05 01:00:36 -05:00
committed by GitHub
parent c3b446be8e
commit 0271abf705
3 changed files with 43 additions and 20 deletions

View File

@@ -18,8 +18,8 @@ import psutil
import yaml
from flask import Flask, request, render_template, send_file, after_this_request, Response, redirect, url_for, abort
from src.api.server_proxy import RenderServerProxy
from src.api.add_job_helpers import handle_uploaded_project_files, process_zipped_project, create_render_jobs
from src.api.serverproxy_manager import ServerProxyManager
from src.distributed_job_manager import DistributedJobManager
from src.engines.core.base_worker import string_to_status, RenderStatus
from src.engines.engine_manager import EngineManager
@@ -211,7 +211,7 @@ def make_job_ready(job_id):
for child_key in found_job.children.keys():
child_id = child_key.split('@')[0]
hostname = child_key.split('@')[-1]
RenderServerProxy(hostname).request_data(f'job/{child_id}/make_ready')
ServerProxyManager.get_proxy_for_hostname(hostname).request_data(f'job/{child_id}/make_ready')
found_job.status = RenderStatus.NOT_STARTED
RenderQueue.save_state()
return found_job.json(), 200