added timeout to DataContext lock acquisition

This commit is contained in:
Flaminel
2026-03-21 21:48:27 +02:00
parent d9a37d7cce
commit 90fedc6fa3

View File

@@ -85,7 +85,11 @@ public sealed class SeekerConfigController : ControllerBase
[HttpPut("seeker")]
public async Task<IActionResult> UpdateSeekerConfig([FromBody] UpdateSeekerConfigRequest request)
{
await DataContext.Lock.WaitAsync();
if (!await DataContext.Lock.WaitAsync(TimeSpan.FromSeconds(30)))
{
return StatusCode(503, "Database is busy, please try again");
}
try
{
var config = await _dataContext.SeekerConfigs.FirstAsync();