Don't throw an error if a task was stopped before it started processing

This commit is contained in:
cmdr2 2022-10-17 17:41:27 +05:30
parent 344fa729a5
commit 9af75bf9b2

View File

@ -582,6 +582,10 @@ async function doMakeImage(task) {
}
} while (serverState.time > (Date.now() - (10 * 1000)) && serverState.task !== renderRequest.task)
if (serverState.session !== 'pending' && serverState.session !== 'running' && serverState.session !== 'buffer') {
if (serverState.session === 'stopped') {
return false
}
throw new Error('Unexpected server task state: ' + serverState.session || 'Undefined')
}
while (serverState.task === renderRequest.task && serverState.session === 'pending') {