forked from extern/easydiffusion
Merge pull request #377 from madrang/beta
Missing '?' in case renderRequest is ever undefined.
This commit is contained in:
parent
19d24e5644
commit
af28d82ebc
@ -522,7 +522,7 @@ async function doMakeImage(task) {
|
|||||||
|
|
||||||
if (typeof renderRequest?.stream !== 'string') {
|
if (typeof renderRequest?.stream !== 'string') {
|
||||||
console.log('Endpoint response: ', renderRequest)
|
console.log('Endpoint response: ', renderRequest)
|
||||||
throw new Error(renderRequest.detail || 'Endpoint response does not contains a response stream url.')
|
throw new Error(renderRequest?.detail || 'Endpoint response does not contains a response stream url.')
|
||||||
}
|
}
|
||||||
|
|
||||||
task['taskStatusLabel'].innerText = "Waiting"
|
task['taskStatusLabel'].innerText = "Waiting"
|
||||||
|
@ -85,9 +85,9 @@ def read_root():
|
|||||||
@app.get('/ping') # Get server and optionally session status.
|
@app.get('/ping') # Get server and optionally session status.
|
||||||
def ping(session_id:str=None):
|
def ping(session_id:str=None):
|
||||||
if not task_manager.render_thread.is_alive(): # Render thread is dead.
|
if not task_manager.render_thread.is_alive(): # Render thread is dead.
|
||||||
if task_manager.current_state_error: raise HTTPException(status_code=500, detail=str(current_state_error))
|
if task_manager.current_state_error: raise HTTPException(status_code=500, detail=str(task_manager.current_state_error))
|
||||||
raise HTTPException(status_code=500, detail='Render thread is dead.')
|
raise HTTPException(status_code=500, detail='Render thread is dead.')
|
||||||
if task_manager.current_state_error and not isinstance(task_manager.current_state_error, StopAsyncIteration): raise HTTPException(status_code=500, detail=str(current_state_error))
|
if task_manager.current_state_error and not isinstance(task_manager.current_state_error, StopAsyncIteration): raise HTTPException(status_code=500, detail=str(task_manager.current_state_error))
|
||||||
# Alive
|
# Alive
|
||||||
response = {'status': str(task_manager.current_state)}
|
response = {'status': str(task_manager.current_state)}
|
||||||
if session_id:
|
if session_id:
|
||||||
@ -223,7 +223,7 @@ def setConfig(config):
|
|||||||
config_json_path = os.path.join(CONFIG_DIR, 'config.json')
|
config_json_path = os.path.join(CONFIG_DIR, 'config.json')
|
||||||
with open(config_json_path, 'w', encoding='utf-8') as f:
|
with open(config_json_path, 'w', encoding='utf-8') as f:
|
||||||
return json.dump(config, f)
|
return json.dump(config, f)
|
||||||
except:
|
except Exception as e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user