예제 #1
0
        public Hive(HiveOptions options)
        {
            try
            {
                this.Options = options;

                lock (RunningHivesListLockObj)
                {
                    Module.CheckInitalized();
                    RunningHivesList.Add(this);
                }

                if (this.Options.IsPollingEnabled)
                {
                    this.StartMainLoop(MainLoopProcAsync);
                }

                if (this.Options.IsAutoArchiverEnabled)
                {
                    this.Archiver = new AutoArchiver(new AutoArchiverOptions(options.PhysicalRootPath._NullCheck(), new FileHistoryManagerPolicy(EnsureSpecial.Yes)));
                }
            }
            catch
            {
                this._DisposeSafe();
                throw;
            }
        }
예제 #2
0
        public static GitRepository GetRepository(string repoUrl)
        {
            Module.CheckInitalized();

            lock (Data.DataLock)
            {
                GitGlobalFsRepository?repoData = Data.ManagedData.RepositoryList.Where(x => x.Url._IsSamei(repoUrl)).SingleOrDefault();

                if (repoData == null || repoData.Repository == null)
                {
                    throw new ApplicationException($"The repository \"{repoUrl}\" is not found by the registered list with StartRepository().");
                }

                return(repoData.Repository);
            }
        }