Ejemplo n.º 1
0
        internal WorkflowDetailsCache(UserDefinedSettings settings, Workflow.Workflow workflow)
        {
            Workflow = workflow;
            Operator = new UpdateOperator(settings);

            Workflow.PostSwitchProject += async(_, mergeRequests) =>
            {
                Trace.TraceInformation("[WorkflowDetailsCache] Processing project switch");

                List <Project> enabledProjects = Workflow.GetProjectsToUpdate();
                Debug.Assert(enabledProjects.Any((x) => x.Id == Workflow.State.Project.Id));

                cacheMergeRequests(Workflow.State.HostName, Workflow.State.Project, mergeRequests);
                await cacheVersionsAsync(Workflow.State.HostName,
                                         InternalDetails.GetMergeRequests(getProjectKey(Workflow.State)));
            };

            Workflow.PostSwitchMergeRequest += async(_) =>
            {
                Trace.TraceInformation("[WorkflowDetailsCache] Processing merge request switch");

                List <Project> enabledProjects = Workflow.GetProjectsToUpdate();
                Debug.Assert(enabledProjects.Any((x) => x.Id == Workflow.State.MergeRequest.Project_Id));

                await cacheVersionsAsync(Workflow.State.HostName, Workflow.State.MergeRequest);
            };
        }
Ejemplo n.º 2
0
 internal RemoteProjectChecker(MergeRequestDescriptor mrd, UpdateOperator updateOperator)
 {
     MergeRequestDescriptor = mrd;
     Operator = updateOperator;
 }