Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12443


Ignore:
Timestamp:
06/15/15 10:52:01 (10 years ago)
Author:
dglaser
Message:

#2394: Fixed UserTaskQuery and GetStatusHistory in the WebApp.Status plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Services.WebApp.Status/3.3/WebApi/DataController.cs

    r12435 r12443  
    4242        SELECT
    4343          DISTINCT UserId,
    44           (SELECT Count FROM UserTasks WHERE TaskState = 'Calculating' AND UserId = ut.UserId) AS CalculatingTasks,
    45           (SELECT Count FROM UserTasks WHERE TaskState = 'Waiting' AND UserId = ut.UserId) AS WaitingTasks
     44          ISNULL((SELECT Count FROM UserTasks WHERE TaskState = 'Calculating' AND UserId = ut.UserId), 0) AS CalculatingTasks,
     45          ISNULL((SELECT Count FROM UserTasks WHERE TaskState = 'Waiting' AND UserId = ut.UserId), 0) AS WaitingTasks
    4646        FROM UserTasks ut;";
    47 
    4847
    4948    private class UserTaskStatus {
     
    129128      }
    130129      using (var db = new HiveDataContext()) {
    131         var statistics = db.Statistics.Where(s => s.Timestamp >= start && s.Timestamp <= end);
     130        var statistics = db.Statistics.Where(s => s.Timestamp >= start && s.Timestamp <= end)
     131                                      .OrderBy(s => s.Timestamp);
    132132        var status = new DTO.Status {
    133133          CoreStatus = new DTO.CoreStatus(),
Note: See TracChangeset for help on using the changeset viewer.