This commit is contained in:
parent
eb9961c77f
commit
f6d14671f5
@ -141,7 +141,7 @@ async def upload(bucket, blob: bytes, thumb: bytes, event_id):
|
|||||||
|
|
||||||
# Generate S3 path based on the JPEG blob SHA512 digest
|
# Generate S3 path based on the JPEG blob SHA512 digest
|
||||||
fp = hashlib.sha512(blob).hexdigest()
|
fp = hashlib.sha512(blob).hexdigest()
|
||||||
path = "%s/%s/%s/%s.jpg" % (fp[:4], fp[4:8], fp[8:12], fp[12:])
|
path = "%s/%s.jpg" % (fp[:4], fp[4:])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await bucket.upload_fileobj(io.BytesIO(thumb), "thumb/%s" % path)
|
await bucket.upload_fileobj(io.BytesIO(thumb), "thumb/%s" % path)
|
||||||
|
Loading…
Reference in New Issue
Block a user