Skip to content

Commit

Permalink
increase request timeout on the sync endpoint, change the path to not…
Browse files Browse the repository at this point in the history
… be redundant
  • Loading branch information
hahn-kev committed Nov 21, 2024
1 parent ba52653 commit 2d63651
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion backend/LexBoxApi/Controllers/CrdtController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,8 +89,9 @@ public async Task<ActionResult<Guid>> GetProjectId(string code)
return Ok(projectId);
}

[HttpPost("crdt-sync/{projectId}")]
[HttpPost("sync/{projectId}")]
[AdminRequired]
[RequestTimeout(300_000)]//5 minutes
public async Task<ActionResult<SyncResult?>> ExecuteMerge(Guid projectId)
{
var result = await fwHeadlessClient.CrdtSync(projectId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
async function triggerSync(): Promise<void> {
syncing = true;
try {
const response = await fetch(`/api/crdt/crdt-sync/${projectId}`, {
const response = await fetch(`/api/crdt/sync/${projectId}`, {
method: 'POST',
});
Expand Down

0 comments on commit 2d63651

Please sign in to comment.