Exemple #1
0
        public void Start(IContainer container)
        {
            if (IsStarted)
            {
                throw new InvalidOperationException("Service already started");
            }
            IsStarted   = true;
            isFinishing = false;
            log.Info("Goal task factory started");

            taskScheduler   = new SchedulerFactoryTaskScheduler(workersAmount);
            runningTasks    = new List <PersistentSchedulerTask>();
            taskFactory     = new TaskFactory <PersistentSchedulerTask>(taskScheduler);
            queueCheckTimer = new Timer(CheckQueue, this, TimeSpan.FromSeconds(TIMER_CHECK_INTERVAL), TimeSpan.FromSeconds(TIMER_CHECK_INTERVAL));
            this.container  = container;

            lock (repoLocker)
            {
                repo.Normalize();
                repo.RemoveOldExecutables();
            }
            recurrencyController.CheckSchedules(this);

            OnFactoryStated();
        }
        public void Start(IContainer container)
        {
            if (IsStarted) throw new InvalidOperationException("Service already started");
            IsStarted = true;
            isFinishing = false;
            log.Info("Goal task factory started");

            taskScheduler = new SchedulerFactoryTaskScheduler(workersAmount);
            runningTasks = new List<PersistentSchedulerTask>();
            taskFactory = new TaskFactory<PersistentSchedulerTask>(taskScheduler);
            queueCheckTimer = new Timer(CheckQueue, this, TimeSpan.FromSeconds(TIMER_CHECK_INTERVAL), TimeSpan.FromSeconds(TIMER_CHECK_INTERVAL));
            this.container = container;

            lock (repoLocker)
            {
                repo.Normalize();
                repo.RemoveOldExecutables();
            }
            recurrencyController.CheckSchedules(this);

            OnFactoryStated();
        }