Example #1
0
        static BaseStorageSettings()
        {
            Cache = new KafkaCache <ConsumerCacheItem>();
            Cache.Subscribe((i) =>
            {
                var settings = StorageSettings.Load();
                if (i.Name == settings.Module)
                {
                    settings.Clear();
                }

                var cdnSettings = CdnStorageSettings.Load();
                if (i.Name == cdnSettings.Module)
                {
                    cdnSettings.Clear();
                }
            }, CacheNotifyAction.Remove);
        }
Example #2
0
        static BaseStorageSettings()
        {
            AscCache.Notify.Subscribe <Consumer>((i, a) =>
            {
                if (a == CacheNotifyAction.Remove)
                {
                    var settings = StorageSettings.Load();
                    if (i.Name == settings.Module)
                    {
                        settings.Clear();
                    }

                    var cdnSettings = CdnStorageSettings.Load();
                    if (i.Name == cdnSettings.Module)
                    {
                        cdnSettings.Clear();
                    }
                }
            });
        }
        static BaseStorageSettings()
        {
            AscCache.Notify.Subscribe <ConsumerCacheItem>((i, a) =>
            {
                if (a == CacheNotifyAction.Remove)
                {
                    CoreContext.TenantManager.SetCurrentTenant(i.TenantId);

                    var settings = StorageSettings.Load();
                    if (i.Name == settings.Module)
                    {
                        settings.Clear();
                    }

                    var cdnSettings = CdnStorageSettings.Load();
                    if (i.Name == cdnSettings.Module)
                    {
                        cdnSettings.Clear();
                    }
                }
            });
        }