Looks like we finally have a solution.

Change logging to just log a message, instead of the exception.
Moved logic to Syncer involvement.  When posting the data, if a 500 is
returned, then it is up to the Syncer to re-submit it.
This commit is contained in:
Mario Steele 2025-08-09 04:09:17 -05:00
parent 73955353cb
commit 004c490dd8
23 changed files with 529 additions and 177 deletions

View file

@ -33,25 +33,20 @@ public static class SettingEndpoint
{
try
{
logger.LogInformation("Setting {id} does not exist, adding it to the database", setting._id);
await repository.AddAsync(setting, ct);
}
catch (Exception ex)
catch (Exception)
{
logger.LogError(ex, "Failed to add setting {setting}", setting._id);
logger.LogError("Failed to add setting {setting}", setting._id);
return Results.StatusCode(500);
}
}
else
{
try
{
await repository.UpdateAsync(setting, ct);
}
catch (Exception ex)
{
logger.LogError(ex, "Failed to update setting {setting}", setting._id);
return Results.StatusCode(500);
}
logger.LogInformation("Setting {id} exists, updating the database.", setting._id);
res.UpdateFrom(setting);
await repository.UpdateAsync(res, ct);
}
return Results.Ok();
}