예제 #1
0
        public Uri InvokeTriggeredJob(string jobName, string arguments, string trigger)
        {
            TriggeredJob triggeredJob = GetJob(jobName);

            if (triggeredJob == null)
            {
                throw new JobNotFoundException($"Cannot find '{jobName}' triggered job");
            }

            triggeredJob.CommandArguments = arguments;

            if (IsShuttingdown)
            {
                throw new WebJobsStoppedException();
            }

            TriggeredJobRunner triggeredJobRunner =
                _triggeredJobRunners.GetOrAdd(
                    jobName,
                    _ => new TriggeredJobRunner(triggeredJob.Name, JobsBinariesPath, Environment, Settings, TraceFactory, Analytics));

            JobSettings jobSettings = triggeredJob.Settings;

            string runId = triggeredJobRunner.StartJobRun(triggeredJob, jobSettings, trigger, ReportTriggeredJobFinished);

            ClearJobListCache();

            return(BuildJobsUrl("{0}/history/{1}".FormatInvariant(jobName, runId)));
        }
예제 #2
0
        public void InvokeTriggeredJob(string jobName, string arguments, string trigger)
        {
            TriggeredJob triggeredJob = GetJob(jobName);

            if (triggeredJob == null)
            {
                throw new JobNotFoundException();
            }

            triggeredJob.CommandArguments = arguments;

            if (IsShuttingdown)
            {
                throw new WebJobsStoppedException();
            }

            TriggeredJobRunner triggeredJobRunner =
                _triggeredJobRunners.GetOrAdd(
                    jobName,
                    _ => new TriggeredJobRunner(triggeredJob.Name, Environment, Settings, TraceFactory, Analytics));

            JobSettings jobSettings = triggeredJob.Settings;

            triggeredJobRunner.StartJobRun(triggeredJob, jobSettings, trigger, ReportTriggeredJobFinished);
            ClearJobListCache();
        }
예제 #3
0
        public void InvokeTriggeredJob(string jobName)
        {
            TriggeredJob triggeredJob = GetJob(jobName);

            if (triggeredJob == null)
            {
                throw new JobNotFoundException();
            }

            TriggeredJobRunner triggeredJobRunner =
                _triggeredJobRunners.GetOrAdd(
                    jobName,
                    _ => new TriggeredJobRunner(triggeredJob.Name, Environment, Settings, TraceFactory, Analytics));

            triggeredJobRunner.StartJobRun(triggeredJob);
        }
예제 #4
0
        public void InvokeTriggeredJob(string jobName)
        {
            TriggeredJob triggeredJob = GetJob(jobName);

            if (triggeredJob == null)
            {
                throw new JobNotFoundException();
            }

            if (IsShuttingdown)
            {
                throw new WebJobsStoppedException();
            }

            TriggeredJobRunner triggeredJobRunner =
                _triggeredJobRunners.GetOrAdd(
                    jobName,
                    _ => new TriggeredJobRunner(triggeredJob.Name, Environment, Settings, TraceFactory, Analytics));

            triggeredJobRunner.StartJobRun(triggeredJob, ReportTriggeredJobFinished);
        }