added create / compare hashes and notify on miss-match for MinIO backups;

This commit is contained in:
Marco Zeisler
2020-12-06 16:48:50 +01:00
parent 7eb728968a
commit 776c144f3f
3 changed files with 57 additions and 25 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
from typing import Union
import requests
from django.conf import settings
@@ -31,11 +33,11 @@ class MinioService:
:param filename: filename
:return: bytes representation of the file or None on error
"""
file_bytes: bytes
file_bytes: Union[bytes, None] = None
try:
url = settings.AWS_HOST + filename
response = requests.get(url, stream=True)
file_bytes=response.content
except:
print("Error downloading file from minio")
return file_bytes
return file_bytes