parent
1ddc73416c
commit
12924784ce
6 changed files with 93 additions and 12 deletions
|
@ -1,13 +1,12 @@
|
|||
import logging
|
||||
import json
|
||||
import features
|
||||
|
||||
from flask import make_response, request, session, Response, redirect, abort as flask_abort
|
||||
from functools import wraps
|
||||
from datetime import datetime
|
||||
from time import time
|
||||
|
||||
from app import storage as store, image_replication_queue, app
|
||||
from app import storage as store, app
|
||||
from auth.auth import process_auth, extract_namespace_repo_from_session
|
||||
from auth.auth_context import get_authenticated_user
|
||||
from auth.registry_jwt_auth import get_granted_username
|
||||
|
@ -21,6 +20,7 @@ from util.registry import gzipstream
|
|||
from util.registry.torrent import PieceHasher
|
||||
from endpoints.v1 import v1_bp
|
||||
from endpoints.decorators import anon_protect
|
||||
from util.registry.replication import queue_storage_replication
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -43,12 +43,7 @@ def _finish_image(namespace, repository, repo_image):
|
|||
set_uploading_flag(repo_image, False)
|
||||
|
||||
# Send a job to the work queue to replicate the image layer.
|
||||
if features.STORAGE_REPLICATION:
|
||||
repo = model.repository.get_repository(namespace, repository)
|
||||
image_replication_queue.put([repo_image.storage.uuid], json.dumps({
|
||||
'namespace_user_id': repo.namespace_user.id,
|
||||
'storage_id': repo_image.storage.uuid,
|
||||
}))
|
||||
queue_storage_replication(namespace, repo_image.storage)
|
||||
|
||||
|
||||
def require_completion(f):
|
||||
|
|
Reference in a new issue