Get the worker and the registry playing nice together.
This commit is contained in:
parent
63ffa52245
commit
2fcd8df42b
3 changed files with 30 additions and 5 deletions
|
@ -7,6 +7,7 @@ from datetime import datetime
|
|||
from time import time
|
||||
|
||||
import storage
|
||||
from data.queue import image_diff_queue
|
||||
|
||||
from app import app
|
||||
from auth.auth import process_auth, extract_namespace_repo_from_session
|
||||
|
@ -142,6 +143,16 @@ def put_image_layer(namespace, repository, image_id):
|
|||
abort(400) # 'Checksum mismatch, ignoring the layer')
|
||||
# Checksum is ok, we remove the marker
|
||||
store.remove(mark_path)
|
||||
|
||||
# The layer is ready for download, send a job to the work queue to
|
||||
# process it.
|
||||
logger.debug('Queing diffs job for image: %s' % image_id)
|
||||
image_diff_queue.put(json.dumps({
|
||||
'namespace': namespace,
|
||||
'repository': repository,
|
||||
'image_id': image_id,
|
||||
}))
|
||||
|
||||
return make_response('true', 200)
|
||||
|
||||
|
||||
|
@ -173,6 +184,16 @@ def put_image_checksum(namespace, repository, image_id):
|
|||
abort(400) # 'Checksum mismatch')
|
||||
# Checksum is ok, we remove the marker
|
||||
store.remove(mark_path)
|
||||
|
||||
# The layer is ready for download, send a job to the work queue to
|
||||
# process it.
|
||||
logger.debug('Queing diffs job for image: %s' % image_id)
|
||||
image_diff_queue.put(json.dumps({
|
||||
'namespace': namespace,
|
||||
'repository': repository,
|
||||
'image_id': image_id,
|
||||
}))
|
||||
|
||||
return make_response('true', 200)
|
||||
|
||||
|
||||
|
|
Reference in a new issue