Add log messages in MinioService
This commit is contained in:
parent
94ffac4984
commit
75299189b6
@ -55,12 +55,14 @@ class MinioService(StorageServiceInterface):
|
||||
:return True if successful, False otherwise
|
||||
"""
|
||||
identifier = filename.strip('.jpg')
|
||||
print("Trying to update image with identifier ", identifier)
|
||||
print("MinioService: Trying to update image with identifier ", identifier)
|
||||
try:
|
||||
headers = {'Content-Type': 'binary/octet-stream'}
|
||||
i = 0
|
||||
while MinioService.read_file(identifier + '_' + str(i) + '.jpg') is not False:
|
||||
print("MinioService: Version %s exists".format(identifier + '_' + str(i) + '.jpg'))
|
||||
i = i + 1
|
||||
print("MinioService: Creating new version %s".format(identifier + '_' + str(i) + '.jpg'))
|
||||
url = settings.AWS_HOST + identifier + '_' + str(i) + '.jpg'
|
||||
r = requests.put(url, data=file, headers=headers)
|
||||
if r.status_code == 200:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user