public IList <ResourceRequiredContext> CombineStylesheets(
            IList <ResourceRequiredContext> resources,
            ICombinatorSettings settings)
        {
            var fingerprint = resources.GetResourceListFingerprint(settings);

            if (!_cacheFileService.Exists(fingerprint, settings))
            {
                Combine(resources, fingerprint, ResourceType.Style, settings);
            }

            return(ProcessCombinedResources(_cacheFileService.GetCombinedResources(fingerprint, settings), settings.ResourceBaseUri));
        }
Beispiel #2
0
        public IList <ResourceRequiredContext> CombineStylesheets(
            IList <ResourceRequiredContext> resources,
            ICombinatorSettings settings)
        {
            var hashCode = resources.GetResourceListHashCode();
            var lockName = MakeLockName(hashCode);

            return(_lockingCacheManager.Get(lockName, ctx =>
            {
                if (!_cacheFileService.Exists(hashCode))
                {
                    Combine(resources, hashCode, ResourceType.Style, settings);
                }

                _combinatorEventMonitor.MonitorCacheEmptied(ctx);

                return ProcessCombinedResources(_cacheFileService.GetCombinedResources(hashCode));
            }, () => resources));
        }