CalendarAggregator.Scheduler.StopTaskForId C# (CSharp) Метод

StopTaskForId() публичный статический Метод

public static StopTaskForId ( string id, TaskType type ) : void
id string
type TaskType
Результат void
        public static void StopTaskForId(string id, TaskType type)
        {
            var task = new Dictionary<string, object>();
            task["id"] = id;
            task["stop"] = DateTime.UtcNow;
            task["status"] = TaskStatus.stopped.ToString();
            var tasktable = type.ToString();
            var ts_response = TableStorage.UpmergeDictToTableStore(task, table: tasktable, partkey: master_pk, rowkey: id);
            GenUtils.LogMsg("status", "Scheduler.StopTaskForId: " + id, ts_response.http_response.status.ToString());
        }

Usage Example

Пример #1
0
        public void StopTaskForIdYieldsStopTimeGreaterThanStartTime()
        {
            Scheduler.InitTaskForId(testid, test_task_type);
            Scheduler.StartTaskForId(testid, test_task_type);
            Utils.Wait(3);
            Scheduler.StopTaskForId(testid, test_task_type);
            var task = Scheduler.FetchTaskForId(testid, test_task_type);

            Assert.Greater(task.stop, task.start);
        }