1
0
Fork 0

fix(api): clean up background jobs once they are ready (for #55)

This commit is contained in:
Sean Sube 2023-01-15 11:43:47 -06:00
parent e4020cf3f6
commit 9c93e16698
1 changed files with 5 additions and 1 deletions

View File

@ -605,9 +605,13 @@ def inpaint():
@app.route('/api/ready')
def ready():
output_file = request.args.get('output', None)
done = executor.futures.done(output_file)
if done == True:
executor.futures.pop(output_file)
return jsonify({
'ready': executor.futures.done(output_file),
'ready': done,
})