Esempio n. 1
0
        public string TaskCreate(ulong SequenceId, Packs Package, CONST.LaunchMode LaunchMode, TaskFileDescription[] InputFiles, TaskFileDescription[] OutputFiles, string[] ParamKeys, string[] ParamValues)
        {
            lock (_taskServiceLock)
            {
                Task task = new Task(SequenceId, Package, LaunchMode, InputFiles, OutputFiles);

                if (ParamKeys != null && ParamKeys.Length > 0)
                {
                    if (ParamKeys.Length != ParamValues.Length)
                    {
                        throw new Exception("Param keys and values lengths must be equal!");
                    }

                    int length = ParamKeys.Length;
                    for (int i = 0; i < length; i++)
                    {
                        task.Params[ParamKeys[i]] = ParamValues[i];
                    }
                }

                Log.Debug(String.Format(
                              "Цепочка {0}: создана задача {1}", SequenceId, task.TaskId
                              ));
                task.Save();

                return(task.TaskId);
            }
        }
Esempio n. 2
0
        public double EstimateTime(Packs Package, CONST.LaunchMode LaunchMode, TaskFileDescription[] InputFiles, TaskFileDescription[] OutputFiles, string[] ParamKeys, string[] ParamValues)
        {
            string taskId = TaskCreate(0, Package, LaunchMode, InputFiles, OutputFiles, ParamKeys, ParamValues);

            return(TaskEstimateTime(taskId));
        }