From 2d636512dc3c61669d490ed5bbca221fec654044 Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Thu, 21 Nov 2024 10:02:11 +0700 Subject: [PATCH] increase request timeout on the sync endpoint, change the path to not be redundant --- backend/LexBoxApi/Controllers/CrdtController.cs | 4 +++- .../project/[project_code]/CrdtSyncButton.svelte | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/LexBoxApi/Controllers/CrdtController.cs b/backend/LexBoxApi/Controllers/CrdtController.cs index d340ae458..6a601377d 100644 --- a/backend/LexBoxApi/Controllers/CrdtController.cs +++ b/backend/LexBoxApi/Controllers/CrdtController.cs @@ -6,6 +6,7 @@ using LexCore.ServiceInterfaces; using LexCore.Sync; using LexData; +using Microsoft.AspNetCore.Http.Timeouts; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; using Microsoft.EntityFrameworkCore; @@ -88,8 +89,9 @@ public async Task> GetProjectId(string code) return Ok(projectId); } - [HttpPost("crdt-sync/{projectId}")] + [HttpPost("sync/{projectId}")] [AdminRequired] + [RequestTimeout(300_000)]//5 minutes public async Task> ExecuteMerge(Guid projectId) { var result = await fwHeadlessClient.CrdtSync(projectId); diff --git a/frontend/src/routes/(authenticated)/project/[project_code]/CrdtSyncButton.svelte b/frontend/src/routes/(authenticated)/project/[project_code]/CrdtSyncButton.svelte index 4c27935b3..324c40126 100644 --- a/frontend/src/routes/(authenticated)/project/[project_code]/CrdtSyncButton.svelte +++ b/frontend/src/routes/(authenticated)/project/[project_code]/CrdtSyncButton.svelte @@ -12,7 +12,7 @@ async function triggerSync(): Promise { syncing = true; try { - const response = await fetch(`/api/crdt/crdt-sync/${projectId}`, { + const response = await fetch(`/api/crdt/sync/${projectId}`, { method: 'POST', });