public ScheduledTasksController(IScheduledTaskService scheduledTaskService, IModelMapper modelMapper, IDataSerializer dataSerializer, ILogger logger)
 {
     _scheduledTaskService = scheduledTaskService;
     _modelMapper          = modelMapper;
     _dataSerializer       = dataSerializer;
     _logger = logger;
 }
예제 #2
0
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // SERVICES
            IScheduledTaskService scheduledTaskService = app.ApplicationServices.GetService <IScheduledTaskService>();

            scheduledTaskService.initTaskService();

            // HTTP

            //app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();

                endpoints.MapGet("/", async context =>
                {
                    string version = typeof(Startup).Assembly.GetName().Version.ToString();
                    await context.Response.WriteAsync($"AuctionMaster BACKEND - {version}");
                });
            });
        }
예제 #3
0
        public AdminController(IOrchardServices orchardServices, IScheduledTaskService scheduledTaskService, IDateLocalizationServices dateServices)
        {
            _orchardServices      = orchardServices;
            _scheduledTaskService = scheduledTaskService;
            _dateServices         = dateServices;

            T = NullLocalizer.Instance;
        }
예제 #4
0
 /// <summary>
 /// creates a new <see cref="System.Threading.Tasks.TaskScheduler"/>
 /// </summary>
 /// <param name="logger">access to logging</param>
 /// <param name="configuration">access to configuration</param>
 /// <param name="scheduledtaskservice">access to scheduled task data</param>
 /// <param name="workflowexecutor">executes workflows</param>
 /// <param name="scriptexecutor">executes scripts</param>
 /// <param name="workflowcompiler">compiler for workflow data</param>
 public TaskScheduler(ILogger <TaskScheduler> logger, IConfiguration configuration, IScheduledTaskService scheduledtaskservice, IWorkflowExecutionService workflowexecutor, IScriptExecutionService scriptexecutor, IWorkflowCompiler workflowcompiler)
 {
     this.logger               = logger;
     this.configuration        = configuration;
     this.scheduledtaskservice = scheduledtaskservice;
     this.workflowexecutor     = workflowexecutor;
     this.scriptexecutor       = scriptexecutor;
     this.workflowcompiler     = workflowcompiler;
 }
예제 #5
0
 public NewsController(
     IUserService userService,
     INewsService newsService,
     IScheduledTaskService scheduledTaskService
     ) : base(userService)
 {
     _newsService          = newsService;
     _scheduledTaskService = scheduledTaskService;
 }
예제 #6
0
 public TasksController(
     IUserService userService,
     IScheduledTaskService scheduledTaskService,
     ITaskLogService taskLogService
     ) : base(userService)
 {
     _scheduledTaskService = scheduledTaskService;
     _taskLogService       = taskLogService;
 }
예제 #7
0
 public NewsService(IEMailService emailService, ICategoryService categoryService,
                    IGenericRepository <DataEntities.Model.News> newsRepo,
                    IGenericRepository <DataEntities.Model.User> userRepo,
                    IScheduledTaskService scheduledTaskService)
 {
     _emailService         = emailService;
     _categoryService      = categoryService;
     _newsRepo             = newsRepo;
     _scheduledTaskService = scheduledTaskService;
     _userRepo             = userRepo;
 }
예제 #8
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            System.Data.Entity.Database.SetInitializer(new MyDataContextDbInitializer());
            MogAutomapper.RegisterAutomapper();
            IScheduledTaskService scheduledtasks = DependencyResolver.Current.GetService <IScheduledTaskService>();

            //var scheduledtasks = new Service.ScheduledTaskService(HttpRuntime.Cache);
            scheduledtasks.StartService();
        }
예제 #9
0
 public UserService(IGenericRepository <DataEntities.Model.User> userRepo, IUserFollowService userFollowService, IGenericRepository <DataEntities.Model.AspNetUser> aspNetUserRepo, ICategoryService categoryService,
                    IProvinceService provinceService, ICountryService countryService, IScheduledTaskService scheduledTaskService, IUserRolesService userRolesService, IGenericRepository <DataEntities.Model.UserFollow> userFollowRepo)
 {
     _userFollowService    = userFollowService;
     _userRepo             = userRepo;
     _aspNetUserRepo       = aspNetUserRepo;
     _categoryService      = categoryService;
     _provinceService      = provinceService;
     _countryService       = countryService;
     _scheduledTaskService = scheduledTaskService;
     _userRolesService     = userRolesService;
     _userFollowRepo       = userFollowRepo;
 }
 public ScheduledTaskTasksHandler(IOrchardServices orchardServices,
                                  IScheduledTaskManager taskManager,
                                  IScheduledTaskService scheduledTaskService,
                                  IRepository <ScheduledTaskRecord> repoTasks,
                                  IWorkflowManager workflowManager,
                                  IRazorExecuteService razorExecuteService,
                                  ISweepGenerator sweepGenerator)
 {
     _orchardServices      = orchardServices;
     _taskManager          = taskManager;
     _scheduledTaskService = scheduledTaskService;
     _repoTasks            = repoTasks;
     _workflowManager      = workflowManager;
     _razorExecuteService  = razorExecuteService;
     _sweepGenerator       = sweepGenerator;
     Logger = NullLogger.Instance;
 }
예제 #11
0
 public SchedulerApiController(IScheduledTaskService taskService)
 {
     _taskService = taskService;
 }
 public TaskManager(IScheduledTaskService scheduledTaskService)
 {
     _scheduledTaskService = scheduledTaskService;
 }
 public ScheduledTaskController(IScheduledTaskService service)
 {
     _service = service;
 }
 public SchedulerApiController(IScheduledTaskService taskService)
 {
     if (taskService == null)
         throw new ArgumentNullException("taskService");
     _taskService = taskService;
 }
예제 #15
0
 public SchedulerApiController(IScheduledTaskService taskService)
 {
     _taskService = taskService;
 }
예제 #16
0
 public static void RunScheduledTask(ScheduledTask sTask, ITask associatedTask, IScheduledTaskService scheduledTaskService, ILogger logger, bool autoRun = true)
 {
     try
     {
         sTask.LastStartDateTime = DateTime.UtcNow;
         sTask.IsRunning         = true;
         scheduledTaskService.Update(sTask);
         associatedTask.Run();
         sTask.LastSuccessDateTime = DateTime.UtcNow;
     }
     catch (Exception ex)
     {
         sTask.LastEndDateTime = DateTime.UtcNow;
         logger.LogError <ScheduledTask>(ex, "Failed to complete the task '{0}'", null, associatedTask.SystemName);
         if (sTask.StopOnError && autoRun)
         {
             sTask.Enabled = false;
         }
     }
     finally
     {
         sTask.IsRunning = false;
         //update the task
         scheduledTaskService.Update(sTask);
         //dispose the task
         associatedTask.Dispose();
     }
 }
예제 #17
0
 /// <summary>
 /// creates a new <see cref="ScheduledTaskController"/>
 /// </summary>
 /// <param name="logger">access to logging</param>
 /// <param name="scheduledtaskservice">access to scheduled task data</param>
 public ScheduledTaskController(ILogger <ScheduledTaskController> logger, IScheduledTaskService scheduledtaskservice)
 {
     this.logger = logger;
     this.scheduledtaskservice = scheduledtaskservice;
 }
예제 #18
0
 public TaskController(IScheduledTaskService scheduledTaskService)
 {
     this.ScheduledTaskService = scheduledTaskService;
 }
예제 #19
0
 public ScheduledTaskWorker(ILogger <ScheduledTaskWorker> logger, IScheduledTaskService scheduledTaskService)
 {
     _logger = logger;
     _scheduledTaskService = scheduledTaskService;
 }
예제 #20
0
 public SchedulerJob(ILogger <SchedulerJob> logger, IScheduledTaskService scheduledTaskService)
 {
     _logger = logger;
     _scheduledTaskService = scheduledTaskService;
 }
예제 #21
0
 public JobBase()
 {
     NeedToBeExectuted     = false;
     _scheduledTaskService = new ScheduledTaskService();
 }
예제 #22
0
 public ScheduledTaskController(ILogger <ScheduledTaskController> logger,
                                IScheduledTaskService scheduledTaskService)
 {
     _logger = logger;
     _scheduledTaskService = scheduledTaskService;
 }
예제 #23
0
 public TaskManager(IScheduledTaskService scheduledTaskService, ILogger logger)
 {
     _scheduledTaskService = scheduledTaskService;
     _logger = logger;
 }