// Token: 0x0600037C RID: 892 RVA: 0x000161F8 File Offset: 0x000143F8 private Guid SubmitScheduledJobToScheduler(Guid jobId, ScheduledJob job, bool executeImmediately, bool useLocal) { Guid result; using (IJobSchedulerHelper jobSchedulerHelper = useLocal ? JobScheduler.GetLocalInstance() : JobScheduler.GetMainInstance()) { if (jobId == Guid.Empty) { OrionDiscoveryJobFactory.log.Debug("Adding new job to Job Engine"); result = jobSchedulerHelper.AddJob(job); } else { try { OrionDiscoveryJobFactory.log.DebugFormat("Updating job definition in Job Engine ({0})", jobId); jobSchedulerHelper.UpdateJob(jobId, job, executeImmediately); return(jobId); } catch (FaultException <JobEngineConnectionFault> ) { OrionDiscoveryJobFactory.log.DebugFormat("Unable to update job definition in Job Engine({0}", jobId); throw; } catch (Exception) { OrionDiscoveryJobFactory.log.DebugFormat("Unable to update job definition in Job Engine({0}", jobId); } OrionDiscoveryJobFactory.log.Debug("Adding new job to Job Engine"); result = jobSchedulerHelper.AddJob(job); } } return(result); }