Exemplo n.º 1
0
        private async Task <Result> DeleteConfigsWithProcessors(string flowName, IEnumerable <IFlowDeploymentProcessor> processors)
        {
            Ensure.NotNull(flowName, "flowName");

            // Ensure no other generation process is going with the same flow with generation locks per flows
            var generationLock = this.GenerationLocks.GetLock(flowName);

            if (generationLock == null)
            {
                return(new FailedResult($"config for flow '{flowName}' is being generated, please try again later."));
            }

            using (generationLock)
            {
                using (Logger.BeginScope(("datax/runtimeConfigGeneration/flowConfigsDelete", new Dictionary <string, string>()
                {
                    { "flowName", flowName }
                })))
                {
                    // Call Storage client to get back the associated flow config
                    var config = await FlowData.GetByName(flowName);

                    Ensure.NotNull(config, "config", $"could not find flow for flow name:'{flowName}'");

                    // Initialize a deploy session
                    var session = new FlowDeploymentSession(config);

                    // Run through a chain of processors
                    await processors.ChainTask(p => p.Delete(session));

                    // Return result
                    return(session.Result);
                }
            }
        }
Exemplo n.º 2
0
 public JobDeploymentSession(string name, TokenDictionary tokens, FlowDeploymentSession flow)
     : base(name, tokens)
 {
     this.Flow = flow;
 }
Exemplo n.º 3
0
 public JobDeploymentSession(string name, TokenDictionary tokens, FlowDeploymentSession flow)
     : base(name, tokens)
 {
     this.Flow       = flow;
     this.JobConfigs = new List <JobConfig>();
 }