Increase nginx proxy timeout and close db before storage operation
This commit is contained in:
parent
597d6ecd3c
commit
8781cf6e11
2 changed files with 13 additions and 10 deletions
|
@ -64,6 +64,8 @@ location ~ ^/v2 {
|
||||||
|
|
||||||
proxy_request_buffering off;
|
proxy_request_buffering off;
|
||||||
|
|
||||||
|
proxy_read_timeout 300;
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
proxy_pass http://registry_app_server;
|
proxy_pass http://registry_app_server;
|
||||||
|
|
|
@ -215,9 +215,10 @@ def _finish_upload(namespace, repo_name, upload_obj, expected_digest):
|
||||||
if not digest_tools.digests_equal(computed_digest, expected_digest):
|
if not digest_tools.digests_equal(computed_digest, expected_digest):
|
||||||
raise BlobUploadInvalid()
|
raise BlobUploadInvalid()
|
||||||
|
|
||||||
# Move the storage into place, or if this was a re-upload, cancel it
|
|
||||||
final_blob_location = digest_tools.content_path(expected_digest)
|
final_blob_location = digest_tools.content_path(expected_digest)
|
||||||
|
|
||||||
|
# Move the storage into place, or if this was a re-upload, cancel it
|
||||||
|
with database.CloseForLongOperation(app.config):
|
||||||
if storage.exists({upload_obj.location.name}, final_blob_location):
|
if storage.exists({upload_obj.location.name}, final_blob_location):
|
||||||
# It already existed, clean up our upload which served as proof that we had the file
|
# It already existed, clean up our upload which served as proof that we had the file
|
||||||
storage.cancel_chunked_upload({upload_obj.location.name}, upload_obj.uuid,
|
storage.cancel_chunked_upload({upload_obj.location.name}, upload_obj.uuid,
|
||||||
|
|
Reference in a new issue