Пример #1
0
        private async Task ProcessTasks(List <TaskSch> tasks)
        {
            List <Task> taskList = new List <Task>();


            if (tasks != null)
            {
                foreach (var task in tasks)
                {
                    ProcessUtils.AdbOpenApps(task.MobileIndex, "com.facebook.katana");
                    taskList.Add(TasksSchedule.ProcessSingleTask(task));
                }

                await Task.Delay(5000);

                try
                {
                    await Task.WhenAll(taskList);

                    foreach (var task in tasks)
                    {
                        TasksBLL.UpdateTimedTaskExecuteTime(task.Id);
                    }
                }
                catch (Exception ex)
                {
                    LogUtils.Error($"{ex}");

                    foreach (var task in tasks)
                    {
                        TasksBLL.UpdateTimedTaskExecuteTime(task.Id);
                    }

                    _previousTimedTaskByGroupFinished = true;
                }
            }

            _previousTimedTaskByGroupFinished = true;
        }