コード例 #1
0
        // -----------------------------------------------------------------------------
        public UpdatedStagingBatch(UpdateDetectionVariables updateDetectionVariables, IsStopRequestedFunc shouldIStop)
        {
            _UpdateDetectionVariables = updateDetectionVariables;
            _shouldIStop = shouldIStop;

            GetBatchFromDB();
        }
コード例 #2
0
        // -----------------------------------------------------------------------------
        public void Start()
        {
            try
            {
                // Read from konfig
                LoadMembersFromConfig();

                if (Disposed)
                {
                    throw new ObjectDisposedException("UpdateLib.Runner.Start()", "Object is disposed");
                }

                lock (_stoppedLock)
                {
                    if (_stopped == true)
                    {
                        LogHelper.LogToFile("-----------------------------------------------------------------------------");
                        LogHelper.LogToFile("INFO: Attempting to START " + _UpdateDetectionVariables.ServiceName + "...");

                        // Start process thread
                        _worker = new WorkerThread(DoOneBatch, _UpdateDetectionVariables.Tag);

                        _stopRequestedFunc = _worker.IsStopRequested;
                        _worker.Start();

                        _stopped = false;

                        LogHelper.LogToFile("INFO: CPRBroker service URL=[" + _CPRBrokerServiceURL + "]");
                        LogHelper.LogToFile("INFO: Application token=[" + _appToken + "]");
                        LogHelper.LogToFile("INFO: Runtime identity=[" + _runIdentity + "]");
                        LogHelper.LogToFile("INFO: Batch run attempted every " + _pollInterval.ToString() + " seconds!");

                        LogHelper.LogToFile("INFO: " + _UpdateDetectionVariables.ServiceName + "...");
                        LogHelper.LogToFile("INFO: ---");
                    }
                }

                // Force timer construction
                PollInterval = _pollInterval;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
 // -----------------------------------------------------------------------------
 public DPRUpdatedStagingBatch(IsStopRequestedFunc shouldIStop)
     : base(shouldIStop)
 {
 }
コード例 #4
0
ファイル: DPRRunner.cs プロジェクト: magenta-aps/cprbroker
 protected override UpdatedStagingBatch CreateUpdatedStagingBatch(IsStopRequestedFunc stopRequestedFunc)
 {
     return(new DPRUpdatedStagingBatch(stopRequestedFunc));
 }