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

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

public static UpdateStartTaskForId ( string id, TaskType type ) : ElmcityUtils.HttpResponse
id string
type TaskType
Результат ElmcityUtils.HttpResponse
        public static HttpResponse UpdateStartTaskForId(string id, TaskType type)
        {
            var task = new Dictionary<string, object>();
            task["id"] = id;
            task["start"] = DateTime.UtcNow;
            task["status"] = TaskStatus.running.ToString();
            task["hostname"] = System.Net.Dns.GetHostName();
            var tasktable = type.ToString();
            var ts_response = TableStorage.UpmergeDictToTableStore(task, tasktable, partkey: master_pk, rowkey: id);
            var http_response = ts_response.http_response;
            GenUtils.LogMsg("status", "Scheduler.UpdateStartTaskForId: " + id, http_response.status.ToString());
            return http_response;
        }

Usage Example

Пример #1
0
        public void UpdateStartTaskForIdYieldsRunning()
        {
            Scheduler.InitTaskForId(testid, test_task_type);
            Scheduler.StartTaskForId(testid, test_task_type);
            Scheduler.UpdateStartTaskForId(testid, test_task_type);
            var task = Scheduler.FetchTaskForId(testid, test_task_type);

            Assert.AreEqual(TaskStatus.running, task.status);
        }