From 35579093ca36614d3aa3e3a5293dcebbc4ef7bfd Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Wed, 3 Aug 2016 15:18:51 -0400 Subject: [PATCH] s/close_db_filter/CloseForLongOperation --- endpoints/v2/blob.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/endpoints/v2/blob.py b/endpoints/v2/blob.py index c3eabef38..8f6a43277 100644 --- a/endpoints/v2/blob.py +++ b/endpoints/v2/blob.py @@ -95,16 +95,16 @@ def download_blob(namespace_name, repo_name, digest): # Close the database connection before we stream the download. logger.debug('Closing database connection before streaming layer data') - database.close_db_filter(None) + with database.CloseForLongOperation(app.config): + # Stream the response to the Docker client. + return Response( + storage.stream_read(blob.locations, path), + headers=headers.update({ + 'Content-Length': blob.size, + 'Content-Type': BLOB_CONTENT_TYPE, + }), + ) - # Stream the response to the Docker client. - return Response( - storage.stream_read(blob.locations, path), - headers=headers.update({ - 'Content-Length': blob.size, - 'Content-Type': BLOB_CONTENT_TYPE, - }), - ) @v2_bp.route('//blobs/uploads/', methods=['POST'])