Beispiel #1
0
        /// <summary>
        /// Initialize the service.
        /// </summary>
        protected override void Initialize()
        {
            _nasArchive.ResetFailedRestoreQueueItems();

            // Start the thread pool
            if (!_threadPool.Active)
            {
                _threadPool.Start();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initialize the service.
        /// </summary>
        protected override bool Initialize()
        {
            _hsmArchive.ResetFailedRestoreQueueItems();

            // Start the thread pool
            if (!_threadPool.Active)
            {
                _threadPool.Start();
            }

            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Initialize the Reindex.  Determine the number of studies in the database and the number of folders on disk to be used
        /// for progress.
        /// </summary>
        public void Initialize()
        {
            // Before scanning the study folders, cleanup any empty directories.
            CleanupFilestoreDirectory();

            try
            {
                DirectoryList = new List <string>(Directory.GetDirectories(FilestoreDirectory));
            }
            catch (Exception x)
            {
                Platform.Log(LogLevel.Error, x);
                throw;
            }

            StudyFoldersToScan = DirectoryList.Count;

            // TODO (CR Jun 2012): Seems we're using the "work item" mutex for all updates to the database.
            // Should we just pass in a boolean specifying whether or not to use a mutex?
            using (var context = new DataAccessContext(DataAccessContext.WorkItemMutex))
            {
                var broker = context.GetStudyBroker();

                StudyOidList = new List <long>();

                var studyList = broker.GetStudies();
                foreach (var study in studyList)
                {
                    study.Reindex = true;
                    StudyOidList.Add(study.Oid);
                }
                context.Commit();
            }

            DatabaseStudiesToScan = StudyOidList.Count;

            _threadPool.Start();
        }