Further improvements on the open hours endpoints
This commit is contained in:
@@ -11,18 +11,18 @@ public static class SystemEndpoints
|
||||
})
|
||||
.WithName("GetVersion");
|
||||
|
||||
app.MapGet("/health/db", async (SqliteConnection connection) =>
|
||||
app.MapGet("/health/db", async (Microsoft.Data.Sqlite.SqliteConnection connection) =>
|
||||
{
|
||||
await connection.OpenAsync();
|
||||
await using var command = connection.CreateCommand();
|
||||
command.CommandText = "SELECT 1";
|
||||
var result = await command.ExecuteScalarAsync();
|
||||
|
||||
return Results.Ok(new
|
||||
return new
|
||||
{
|
||||
Database = "ok",
|
||||
Result = result
|
||||
});
|
||||
};
|
||||
})
|
||||
.WithName("GetDatabaseHealth");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user