Ejemplo n.º 1
0
        public void OnCustomCacheRebuild(object sender, EventArgs args)
        {
            Assert.IsNotNull(args, "Args");

            try
            {
                var cacheRebuildArgs = args as CacheRebuildEventArgs;
                var rebuildService   = new CacheRebuildService();

                Log.Info(
                    $"CacheRebuildEventHandler: Event Raised: key:{cacheRebuildArgs?.EventInfo?.CacheKey} database:{cacheRebuildArgs?.EventInfo?.Database} field:{cacheRebuildArgs?.EventInfo?.Field}",
                    this);

                rebuildService.Rebuild(sender, cacheRebuildArgs);
            }

            catch (Exception exc)
            {
                Log.Warn($"CacheRebuildEventHandler: Exception while trying to rebuild cache {exc.Message}", this);
            }
        }
Ejemplo n.º 2
0
        public void RaiseEvent(CacheRebuildEvent @event)
        {
            var rebuildService = new CacheRebuildService();

            rebuildService.Rebuild(this, new CacheRebuildEventArgs(@event));
        }