s3: add support for failover

This commit is contained in:
Abdullah Atta
2025-12-17 09:06:26 +05:00
parent 347507f00a
commit 265b456c46
5 changed files with 494 additions and 99 deletions

View File

@@ -102,7 +102,7 @@ namespace Notesnook.API.Controllers
private async Task<long> UploadFileAsync(string userId, string name, long fileSize)
{
var url = s3Service.GetInternalUploadObjectUrl(userId, name) ?? throw new Exception("Could not create signed url.");
var url = await s3Service.GetInternalUploadObjectUrlAsync(userId, name) ?? throw new Exception("Could not create signed url.");
var httpClient = new HttpClient();
var content = new StreamContent(HttpContext.Request.BodyReader.AsStream());
@@ -168,7 +168,7 @@ namespace Notesnook.API.Controllers
try
{
var userId = this.User.GetUserId();
var url = await s3Service.GetDownloadObjectUrl(userId, name);
var url = await s3Service.GetDownloadObjectUrlAsync(userId, name);
if (url == null) return BadRequest("Could not create signed url.");
return Ok(url);
}