Fix issues with the perf updated code

This commit is contained in:
Joseph Schorr 2014-11-07 14:36:32 -05:00
parent d5bbb57481
commit 691be49817
2 changed files with 5 additions and 1 deletions

View file

@ -1235,12 +1235,16 @@ def find_create_or_link_image(docker_image_id, repository, username, translation
# If there is an existing image, we try to translate its ancestry and copy its storage.
new_image = None
try:
logger.debug('Looking up existing image for ID: %s', docker_image_id)
existing_image = existing_image_query.get()
logger.debug('Existing image %s found for ID: %s', existing_image.id, docker_image_id)
new_image = _find_or_link_image(existing_image, repository, username, translations,
preferred_location)
if new_image:
return new_image
except Image.DoesNotExist:
logger.debug('No existing image found for ID: %s', docker_image_id)
pass
# Otherwise, create a new storage directly.

View file

@ -7,7 +7,7 @@ from functools import wraps
from datetime import datetime
from time import time
from app import storage as store, image_diff_queue
from app import storage as store, image_diff_queue, app
from auth.auth import process_auth, extract_namespace_repo_from_session
from util import checksums, changes
from util.http import abort, exact_abort