/// <summary>
 /// Enters the information about the user in Redis.
 /// </summary>
 /// <param name="db">Connecting with Redis.</param>
 /// <param name="user">Instance information about the user.</param>
 /// <param name="logging">Logging class object to create the log.</param>
 private static void RedisSetData(IDatabase db, IReadOnlyList<User> user, Logging logging)
 {
     // Serialization of User class using Json.
     var jsonValue = JsonConvert.SerializeObject(user);
     try
     {
         db.StringSet($"user:{user[0].Id}", jsonValue);
         // Life Time 10 minutes.
         db.KeyExpire($"user:{user[0].Id}", new TimeSpan(0, 10, 0));
     }
     catch (RedisException ex)
     {
         logging.ProcessingException(ex);
     }
 }
        /// <summary>
        /// Find out the state services.
        /// </summary>
        public void GetServiceState(Logging logging)
        {
            // Check if Radish running?
            try
            {
                using (var conn = ConnectionMultiplexer.Connect("localhost"))
                {
                    // YES - Redis running.
                    RedisIsStarted = true;
                    conn.Close();
                }
            }
            catch (RedisException ex)
            {
                logging.ProcessingException(ex);
                // NO - Redis is not running.
                RedisIsStarted = false;

                // Cached database initialization form (-2 seconds).
                var cacheMap = new Thread(CacheThreadMap);
                cacheMap.Start();
                var cacheStorage1 = new Thread(CacheThreadStorage1);
                cacheStorage1.Start();
                var cacheStorage2 = new Thread(CacheThreadStorage2);
                cacheStorage2.Start();
                var cacheStorage3 = new Thread(CacheThreadStorage3);
                cacheStorage3.Start();
                var cacheStorage4 = new Thread(CacheThreadStorage4);
                cacheStorage4.Start();
            }

            // Check if running Sphinx?
            try
            {
                var connection = new SphinxQLConnection(@"Data Source=localhost;Port=9306");
                connection.Open();
                // YES - Sphinx running.
                SphinxIsStarted = true;
                connection.Close();
            }
            catch (SphinxQLException ex)
            {
                logging.ProcessingException(ex);
                // NO - Sphinx NOT running.
                SphinxIsStarted = false;
            }
        }