Ejemplo n.º 1
0
        public static async Task <int> Main()
        {
            IServiceProvider serviceProvider = null;

            try {
                serviceProvider = JobServiceProvider.GetServiceProvider();

                if (!Settings.Current.EnableSnapshotJobs)
                {
                    Log.Logger.Information("Snapshot Jobs are currently disabled.");
                    return(0);
                }

                var job = serviceProvider.GetService <Exceptionless.Core.Jobs.Elastic.OrganizationSnapshotJob>();
                return(await new JobRunner(job, serviceProvider.GetRequiredService <ILoggerFactory>(), runContinuous: false).RunInConsoleAsync());
            } catch (Exception ex) {
                Log.Fatal(ex, "Job terminated unexpectedly");
                return(1);
            } finally {
                Log.CloseAndFlush();
                if (serviceProvider is IDisposable disposable)
                {
                    disposable.Dispose();
                }
                await ExceptionlessClient.Default.ProcessQueueAsync();
            }
        }
Ejemplo n.º 2
0
        public static int Main(string[] args)
        {
            IServiceProvider serviceProvider = null;

            try {
                serviceProvider = JobServiceProvider.GetServiceProvider();

                int result = JobCommands.Run(args, serviceProvider, app => {
                    app.JobConfiguration.Assemblies = new List <string> {
                        "Exceptionless.Core", "Foundatio"
                    };
                });

                return(result);
            } catch (Exception ex) {
                Log.Fatal(ex, "Job terminated unexpectedly");
                return(1);
            } finally {
                Log.CloseAndFlush();
                if (serviceProvider is IDisposable disposable)
                {
                    disposable.Dispose();
                }

                ExceptionlessClient.Default.ProcessQueue();
            }
        }
Ejemplo n.º 3
0
 public static async Task <int> Main()
 {
     try {
         var serviceProvider = JobServiceProvider.GetServiceProvider();
         var job             = serviceProvider.GetService <Exceptionless.Core.Jobs.Elastic.MaintainIndexesJob>();
         return(await new JobRunner(job, serviceProvider.GetRequiredService <ILoggerFactory>(), runContinuous: false).RunInConsoleAsync());
     } catch (Exception ex) {
         Log.Fatal(ex, "Job terminated unexpectedly");
         return(1);
     } finally {
         Log.CloseAndFlush();
         await ExceptionlessClient.Default.ProcessQueueAsync();
     }
 }
Ejemplo n.º 4
0
 public static async Task <int> Main()
 {
     try {
         var serviceProvider = JobServiceProvider.GetServiceProvider();
         var job             = serviceProvider.GetService <Exceptionless.Core.Jobs.WebHooksJob>();
         return(await new JobRunner(job, serviceProvider.GetRequiredService <ILoggerFactory>(), initialDelay: TimeSpan.FromSeconds(5), interval: TimeSpan.Zero, iterationLimit: Settings.Current.JobsIterationLimit).RunInConsoleAsync());
     } catch (Exception ex) {
         Log.Fatal(ex, "Job terminated unexpectedly");
         return(1);
     } finally {
         Log.CloseAndFlush();
         await ExceptionlessClient.Default.ProcessQueueAsync();
     }
 }
Ejemplo n.º 5
0
        public ActionResult PreviousJobs(string name)
        {
            var job = JobServiceProvider.GetJobByTitle(name);

            job.Comments = CommentServiceProvider.GetCommentsByJobId(job.JobId);
            if (TempData["success"] != null)
            {
                ViewBag.Success = "Your comment was posted I hope you are happy about it";
            }
            if (TempData["failed"] != null)
            {
                ViewBag.Failed = "No comment posted sooon";
            }
            return(View(job));
        }
Ejemplo n.º 6
0
        public static async Task <int> Main()
        {
            IServiceProvider serviceProvider = null;

            try {
                serviceProvider = JobServiceProvider.GetServiceProvider();
                return(await new JobRunner(serviceProvider.GetService <Exceptionless.Core.Jobs.StackEventCountJob>(), serviceProvider.GetRequiredService <ILoggerFactory>(), initialDelay: TimeSpan.FromSeconds(2), interval: TimeSpan.FromSeconds(5)).RunInConsoleAsync());
            } catch (Exception ex) {
                Log.Fatal(ex, "Job terminated unexpectedly");
                return(1);
            } finally {
                Log.CloseAndFlush();
                if (serviceProvider is IDisposable disposable)
                {
                    disposable.Dispose();
                }
                await ExceptionlessClient.Default.ProcessQueueAsync();
            }
        }
Ejemplo n.º 7
0
        public static async Task <int> Main()
        {
            IServiceProvider serviceProvider = null;

            try {
                serviceProvider = JobServiceProvider.GetServiceProvider();
                var job = serviceProvider.GetService <Exceptionless.Core.Jobs.DownloadGeoIPDatabaseJob>();
                return(await new JobRunner(job, serviceProvider.GetRequiredService <ILoggerFactory>(), runContinuous: false).RunInConsoleAsync());
            } catch (Exception ex) {
                Log.Fatal(ex, "Job terminated unexpectedly");
                return(1);
            } finally {
                Log.CloseAndFlush();
                if (serviceProvider is IDisposable disposable)
                {
                    disposable.Dispose();
                }
                await ExceptionlessClient.Default.ProcessQueueAsync();
            }
        }
Ejemplo n.º 8
0
        public static async Task <int> Main()
        {
            IServiceProvider serviceProvider = null;

            try {
                serviceProvider = JobServiceProvider.GetServiceProvider();
                var job = serviceProvider.GetService <Foundatio.Jobs.WorkItemJob>();
                return(await new JobRunner(job, serviceProvider.GetRequiredService <ILoggerFactory>(), initialDelay: TimeSpan.FromSeconds(2), interval: TimeSpan.Zero, iterationLimit: Settings.Current.JobsIterationLimit).RunInConsoleAsync());
            } catch (Exception ex) {
                Log.Fatal(ex, "Job terminated unexpectedly");
                return(1);
            } finally {
                Log.CloseAndFlush();
                if (serviceProvider is IDisposable disposable)
                {
                    disposable.Dispose();
                }
                await ExceptionlessClient.Default.ProcessQueueAsync();
            }
        }
Ejemplo n.º 9
0
        public ActionResult About()
        {
            var finishedJobs = JobServiceProvider.GetFinishedJobs();

            return(View(finishedJobs));
        }