feat(ai-studio): resume hosted image jobs
This commit is contained in:
+10
-3
@@ -738,9 +738,16 @@ def update_job_status(
|
||||
return get_job(job_id, conn=database)
|
||||
|
||||
|
||||
def list_resumable_jobs(path=None, conn=None, project_id=None):
|
||||
clauses = ["status IN (?, ?)", "task_id IS NOT NULL"]
|
||||
params = ["submitted", "running"]
|
||||
def list_resumable_jobs(path=None, conn=None, project_id=None, include_failed_downloads=False):
|
||||
if include_failed_downloads:
|
||||
clauses = [
|
||||
"task_id IS NOT NULL",
|
||||
"(status IN (?, ?) OR (status = ? AND output_asset_id IS NULL))",
|
||||
]
|
||||
params = ["submitted", "running", "failed"]
|
||||
else:
|
||||
clauses = ["status IN (?, ?)", "task_id IS NOT NULL"]
|
||||
params = ["submitted", "running"]
|
||||
if project_id is not None:
|
||||
clauses.append("project_id = ?")
|
||||
params.append(int(project_id))
|
||||
|
||||
Reference in New Issue
Block a user