Beispiel #1
0
        public async override Task ExecuteAsync(IOperationExecutionContext context)
        {
            if (!this.ProxyRequest)
            {
                await this.QueueBuildAsync(progress => this.progress = progress, context.CancellationToken).ConfigureAwait(false);

                return;
            }

            var jobExec = await context.Agent.GetServiceAsync <IRemoteJobExecuter>().ConfigureAwait(false);

            using (var job = new QueueBuildRemoteJob(this))
            {
                job.MessageLogged += (s, e) => this.OnMessageLogged(e);
                await jobExec.ExecuteJobAsync(job, context.CancellationToken).ConfigureAwait(false);
            }
        }
Beispiel #2
0
        public async override Task ExecuteAsync(IOperationExecutionContext context)
        {
            if (!this.ProxyRequest)
            {
                this.LogDebug($"Making request from {SDK.ProductName} server...");
                await QueueBuildAsync(this, context.CancellationToken);

                return;
            }

            this.LogDebug($"Making request using agent on {context.ServerName}...");
            var jobExec = await context.Agent.GetServiceAsync <IRemoteJobExecuter>();

            using (var job = new QueueBuildRemoteJob(this))
            {
                job.SetProgressOnOperation = this.SetProgress;
                job.MessageLogged         += (s, e) => this.OnMessageLogged(e);
                await jobExec.ExecuteJobAsync(job, context.CancellationToken);
            }
        }