fix: reduce presigned url len
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -62,7 +62,7 @@ public class S3DvrStore(Config config, HttpClient httpClient, ILogger<S3DvrStore
|
|||||||
{
|
{
|
||||||
BucketName = _config.BucketName,
|
BucketName = _config.BucketName,
|
||||||
Key = key,
|
Key = key,
|
||||||
Expires = DateTime.UtcNow.AddSeconds(604000)
|
Expires = DateTime.UtcNow.AddSeconds(600_000)
|
||||||
});
|
});
|
||||||
|
|
||||||
var ub = new UriBuilder(url)
|
var ub = new UriBuilder(url)
|
||||||
|
@ -36,7 +36,7 @@ public class S3ThumbnailService(Config config, ILogger<S3ThumbnailService> logge
|
|||||||
{
|
{
|
||||||
BucketName = Config.S3Store.BucketName,
|
BucketName = Config.S3Store.BucketName,
|
||||||
Key = s3Path,
|
Key = s3Path,
|
||||||
Expires = DateTime.UtcNow.AddYears(1000)
|
Expires = DateTime.UtcNow.AddSeconds(800_000)
|
||||||
});
|
});
|
||||||
|
|
||||||
var ub = new UriBuilder(uri)
|
var ub = new UriBuilder(uri)
|
||||||
@ -52,13 +52,14 @@ public class S3ThumbnailService(Config config, ILogger<S3ThumbnailService> logge
|
|||||||
.ExecuteUpdateAsync(o => o.SetProperty(v => v.Thumbnail, ub.Uri.ToString()));
|
.ExecuteUpdateAsync(o => o.SetProperty(v => v.Thumbnail, ub.Uri.ToString()));
|
||||||
|
|
||||||
var tDbUpdate = sw.Elapsed;
|
var tDbUpdate = sw.Elapsed;
|
||||||
|
|
||||||
stream.Thumbnail = ub.Uri.ToString();
|
stream.Thumbnail = ub.Uri.ToString();
|
||||||
|
|
||||||
fs.Close();
|
fs.Close();
|
||||||
File.Delete(path);
|
File.Delete(path);
|
||||||
|
|
||||||
Logger.LogInformation("{id} generated={tg:#,##0}ms, uploaded={tu:#,##0}ms, db={td:#,##0}ms", stream.Id, tGen.TotalMilliseconds,
|
Logger.LogInformation("{id} generated={tg:#,##0}ms, uploaded={tu:#,##0}ms, db={td:#,##0}ms", stream.Id,
|
||||||
|
tGen.TotalMilliseconds,
|
||||||
tUpload.TotalMilliseconds, tDbUpdate.TotalMilliseconds);
|
tUpload.TotalMilliseconds, tDbUpdate.TotalMilliseconds);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -71,4 +72,4 @@ public class S3ThumbnailService(Config config, ILogger<S3ThumbnailService> logge
|
|||||||
{
|
{
|
||||||
return $"{id}/thumb.jpg";
|
return $"{id}/thumb.jpg";
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user