Exemple #1
0
        private async Task TaskExecutionProc()
        {
            ITask     task;
            Exception exception;

            if (!m_namesvc.IsMaster)
            {
                return;
            }
            task = await m_taskqueue.GetTask(m_cancel);

            if (task == null)
            {
                return;
            }
            try
            {
                await task.Execute(m_cancel);

                exception = null;
            }
            catch (Exception ex) { exception = ex; }
            if (null == exception)
            {
                if (task is ChainedTasks ctask && !ctask.Finished)
                {
                    await m_taskqueue.UpdateTask(task);
                }
                else
                {
                    await m_taskqueue.RemoveTask(task);
                }
            }