Commit 3ea9fad4 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

when creating a new job: prefer images already pushed to the registry

parent a9c9b7ce
......@@ -1071,8 +1071,12 @@ class JobManager(Manager):
ver = ses.query(WebappVersion).filter_by(
webapp_id = job.webapp_id,
number = job.version).filter(
WebappVersion.state != int(VersionState.error)
).order_by(WebappVersion.id.desc()).first()
WebappVersion.state.in_((
int(VersionState.committed),
int(VersionState.ready)))
).order_by(
WebappVersion.state.desc(),
WebappVersion.id.desc()).first()
if ver is None:
log.error("job %d: webapp %r version %r not found",
job_id, job.webapp.docker_name, job.version)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment