Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/29/20 13:31:30 (5 years ago)
Author:
jkarder
Message:

#3072: fixed statelog updates

  • fixed UpdateTasks so that it selects the correct last slave id for a specified task
  • introduced check if a slave is allowed to update a task's state (IsAuthorizedForTask)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Services.Hive/3.3/Manager/HeartbeatManager.cs

    r17574 r17575  
    120120      var taskInfos = pm.UseTransaction(() =>
    121121        (from task in taskDao.GetAll()
    122           where taskIds.Contains(task.TaskId)
    123           let lastStateLog = task.StateLogs.OrderByDescending(x => x.DateTime).FirstOrDefault()
    124           select new {
    125             TaskId = task.TaskId,
    126             JobId = task.JobId,
    127             State = task.State,
    128             Command = task.Command,
    129             SlaveId = lastStateLog != null ? lastStateLog.SlaveId : default(Guid)
    130           }).ToList()
     122         where taskIds.Contains(task.TaskId)
     123         let lastStateLog = task.StateLogs.OrderByDescending(x => x.DateTime).FirstOrDefault(x => x.State == DA.TaskState.Transferring)
     124         select new {
     125           TaskId = task.TaskId,
     126           JobId = task.JobId,
     127           State = task.State,
     128           Command = task.Command,
     129           SlaveId = lastStateLog != null ? lastStateLog.SlaveId : Guid.Empty
     130         }).ToList()
    131131      );
    132132
Note: See TracChangeset for help on using the changeset viewer.