public TrackerTask InsertTask(TrackerTask task) { _context.Tasks.Add(task); _context.SaveChanges(); return(task); }
public void receiveJobRequest(JobMetadata jobMetadata) { Common.Logger().LogInfo("Job Request received", string.Empty, string.Empty); //now he is a Job Tracker. Implement all job tracker functions upon this //Start channel with other workers as Job tracker JOBTRACKER_URL = serviceUrl;//I set my own as job tracker url isJobTracker = true; CLIENT_URL = jobMetadata.ClientUrl; Console.WriteLine("Job request received for " + JOBTRACKER_URL, string.Empty, string.Empty); //start jobtracker threads //TrackerDetails trackerDetails = new TrackerDetails(CLIENT_URL, existingWorkerMap); trackerTask = new TrackerTask(CLIENT_URL, existingWorkerMap, workerId); client = (IClient)Activator.GetObject(typeof(IClient), CLIENT_URL); trackerTask.notifyWorkersForJobStart(); if (existingWorkerMap.Count > 1) { trackerTask.startHeartBeat();//should work even with 1 } trackerTask.splitJob(jobMetadata); }
public void SetCopyOfTasks(Dictionary <int, Task> tasks, string clientUrl) { trackerTask = new TrackerTask(clientUrl, existingWorkerMap, workerId); client = (IClient)Activator.GetObject(typeof(IClient), clientUrl); trackerTask.SetCopyOfTasks(tasks); Console.WriteLine("Tasklist copied to backup with id***********************" + workerId); Common.Logger().LogInfo("Tasklist copied to backup with id***********************" + workerId, string.Empty, string.Empty); }
public TrackerTask UpdateTask(TrackerTask task) { var taskEntity = GetTask(task.Id); _context.Entry(taskEntity).CurrentValues.SetValues(task); _context.SaveChanges(); return(task); }
public async Task AddTask(string userId, TrackerTaskModel task) { if ((await this._context.Users.FindAsync(userId)) is User user) { TrackerTask taskEntity = new TrackerTask(); taskEntity.Title = task.Title; taskEntity.Description = task.Description; taskEntity.TaskStatus = task.Status; taskEntity.User = user; this._context.TrackerTasks.Add(taskEntity); await this._context.SaveChangesAsync(); } else { throw new BusinessException("Invalid user Id"); } }
public ITrackerActivity UpdateActivity(TrackerTask task) { throw new NotImplementedException(); }