<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using NHibernate.Cache;
using NHibernate.Util;
using ServiceStack.Common;
using ServiceStack.Redis;
using ServiceStack.Redis.Support;
using ServiceStack.Text;

namespace NHibernate.Caches.Redis
{
    public class RedisCache : ICache
    {
        private const string CacheNamePrefix = "NHibernate-Cache:";

        private static readonly IInternalLogger log;
        private static Dictionary<object, string> acquiredLocks = new Dictionary<object, string>();

        private readonly ISerializer serializer;
        private readonly IRedisClientsManager clientManager;
        private readonly int expirySeconds;
        private readonly TimeSpan lockTimeout = TimeSpan.FromSeconds(30);

        public string RegionName { get; private set; }
        public RedisNamespace CacheNamespace { get; private set; }
        public int Timeout { get { return Timestamper.OneMs * 60000; } }

        static RedisCache()
        {
            log = LoggerProvider.LoggerFor(typeof(RedisCache));
        }

        public RedisCache(string regionName, IRedisClientsManager clientManager)
            : this(regionName, new Dictionary<string, string>(), clientManager)
        {

        }

        public RedisCache(string regionName, IDictionary<string, string> properties, IRedisClientsManager clientManager)
        {
            this.serializer = new ObjectSerializer();
            this.clientManager = clientManager.ThrowIfNull("clientManager");
            this.RegionName = regionName.ThrowIfNull("regionName");<commit_msg>Acquired locks don't need to be static.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using NHibernate.Cache;
using NHibernate.Util;
using ServiceStack.Common;
using ServiceStack.Redis;
using ServiceStack.Redis.Support;
using ServiceStack.Text;

namespace NHibernate.Caches.Redis
{
    public class RedisCache : ICache
    {
        private const string CacheNamePrefix = "NHibernate-Cache:";

        private static readonly IInternalLogger log;

        private readonly Dictionary<object, string> acquiredLocks = new Dictionary<object, string>();
        private readonly ISerializer serializer;
        private readonly IRedisClientsManager clientManager;
        private readonly int expirySeconds;
        private readonly TimeSpan lockTimeout = TimeSpan.FromSeconds(30);

        public string RegionName { get; private set; }
        public RedisNamespace CacheNamespace { get; private set; }
        public int Timeout { get { return Timestamper.OneMs * 60000; } }

        static RedisCache()
        {
            log = LoggerProvider.LoggerFor(typeof(RedisCache));
        }

        public RedisCache(string regionName, IRedisClientsManager clientManager)
            : this(regionName, new Dictionary<string, string>(), clientManager)
        {

        }

        public RedisCache(string regionName, IDictionary<string, string> properties, IRedisClientsManager clientManager)
        {
            this.serializer = new ObjectSerializer();
            this.clientManager = clientManager.ThrowIfNull("clientManager");
            this.RegionName = regionName.ThrowIfNull("regionName");
{'fraction_non_alphanumeric': 0.07649599012954966, 'fraction_numerical': 0.00431832202344232, 'mean_word_length': 3.3125, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6528507', 'n_tokens_mistral': 843, 'n_tokens_neox': 802, 'n_words': 219}