ServiceStack.Redis 4.5.6收费版去除6000次数限制

      在微信域名检测项目中,使用使用一个ReaderWriterLock来实现一个同步的Cache, 以便控制对该Cache的读写.但是效果很不好,后来采用利用ServiceStack.Redis来操作Redis,它是Redis官方推荐的C#客户端,性能非常优越,使用也很方便,但是运行中发现有如下的问题: 

每小时只能访问Redis 6000次 

The free-quota limit on ‘6000 Redis requests per hour‘ has been reached. Please see https://servicestack.net to upgrade to a commercial license. 

    用工具查看发现两处限制

// ServiceStack.Text, Version=4.5.6.0, Culture=neutral, PublicKeyToken=null
// Global type: 
// Architecture: AnyCPU (64-bit preferred)
// Runtime: .NET 4.0

public static class LicenseUtils
	{
		//...
		public static class FreeQuotas
		{
			public const int ServiceStackOperations = 10;
			public const int TypeFields = 20;
			public const int RedisTypes = 20;
			public const int RedisRequestPerHour = 6000;
			public const int OrmLiteTables = 10;
			public const int AwsTables = 10;
			public const int PremiumFeature = 0;
		}

         ...
  if (quotaType == QuotaType.RequestsPerHour)
  {
   LicenseUtils.ApprovedUsage(licenseFeature, feature, 6000, count, "The free-quota limit on '{0} Redis requests per hour' has been reached. 
Please see https://servicestack.net to upgrade to a commercial license or
visit https://github.com/ServiceStackV3/ServiceStackV3 to revert back to the free ServiceStack v3."); return; } .... }

    我们把6000转换成字节形式是 70 17 00 00,直接用16进制编辑器打开ServiceStack.Text.dll 查找,修改为FF FF FF 7F,也就是int的最大值2147483647

ServiceStack.Redis 4.5.6下载地址

  • https://download.csdn.net/download/gemgin/10572500

你可能感兴趣的:(ServiceStack.Redis 4.5.6收费版去除6000次数限制)