fix: update

pull/1055/head^2
liuzheng712 2018-03-07 22:15:17 +08:00
parent 51d7e51119
commit 3c6c05f83e
No known key found for this signature in database
GPG Key ID: 76B55D91E7BB2978
1 changed files with 6 additions and 2 deletions

View File

@ -288,8 +288,12 @@ class SessionReplayViewSet(viewsets.ViewSet):
if value.get("TYPE", '') == "s3":
client, bucket = self.s3Client(value)
try:
client.head_object(Bucket=bucket, Key=path)
client.download_file(bucket, path, default_storage.base_location + '/' + path)
date = self.session.date_start.strftime('%Y-%m-%d')
client.head_object(Bucket=bucket,
Key=os.path.join(date, str(self.session.id) + '.replay.gz'))
client.download_file(bucket, os.path.join(date, str(self.session.id) + '.replay.gz'),
default_storage.base_location + '/' + path)
return redirect(default_storage.url(path))
except:
pass