mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-16 08:19:03 +00:00
More error handling...
This commit is contained in:
@@ -185,9 +185,15 @@ func (api *WebAPI) WorkerSetPaused(r *Request) {
|
||||
}
|
||||
|
||||
func (api *WebAPI) GetAllWorkerStats(r *Request) {
|
||||
|
||||
stats := api.Database.GetAllWorkerStats()
|
||||
|
||||
if stats == nil {
|
||||
r.OkJson(JsonResponse{
|
||||
Ok: false,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
r.OkJson(JsonResponse{
|
||||
Ok: true,
|
||||
Content: GetAllWorkerStatsResponse{
|
||||
|
||||
Reference in New Issue
Block a user