Ejemplo n.º 1
0
        internal UpdateManager(
            DataCacheContext dataCacheContext,
            string hostname,
            IHostProperties hostProperties,
            SearchQueryCollection queryCollection,
            InternalCacheUpdater cacheUpdater,
            INetworkOperationStatusListener networkOperationStatusListener,
            bool isApprovalStatusSupported)
        {
            _updateOperator         = new DataCacheOperator(hostname, hostProperties, networkOperationStatusListener);
            _mergeRequestListLoader = new MergeRequestListLoader(
                hostname, _updateOperator, cacheUpdater, null, queryCollection,
                isApprovalStatusSupported);
            _mergeRequestLoader = new MergeRequestLoader(_updateOperator, cacheUpdater,
                                                         dataCacheContext.UpdateRules.UpdateOnlyOpenedMergeRequests, isApprovalStatusSupported);
            _extLogging    = dataCacheContext.UpdateManagerExtendedLogging;
            _tagForLogging = dataCacheContext.TagForLogging;

            _cache = cacheUpdater.Cache;

            _timer = new System.Timers.Timer
            {
                Interval = dataCacheContext.UpdateRules.UpdateMergeRequestsPeriod.Value
            };
            _timer.Elapsed            += onTimer;
            _timer.SynchronizingObject = dataCacheContext.SynchronizeInvoke;
            _timer.Start();
        }
Ejemplo n.º 2
0
        internal UpdateManager(
            DataCacheContext dataCacheContext,
            string hostname,
            IHostProperties hostProperties,
            DataCacheConnectionContext context,
            InternalCacheUpdater cacheUpdater)
        {
            DataCacheOperator updateOperator = new DataCacheOperator(hostname, hostProperties);

            _mergeRequestListLoader = MergeRequestListLoaderFactory.CreateMergeRequestListLoader(
                hostname, updateOperator, context, cacheUpdater);
            _mergeRequestLoader = new MergeRequestLoader(updateOperator, cacheUpdater);

            _cache = cacheUpdater.Cache;

            _timer = new System.Timers.Timer
            {
                Interval = context.UpdateRules.UpdateMergeRequestsPeriod.Value
            };
            _timer.Elapsed            += onTimer;
            _timer.SynchronizingObject = dataCacheContext.SynchronizeInvoke;
            _timer.Start();
        }