Skip to content

Commit

Permalink
Fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zlzforever committed May 3, 2016
1 parent 33dfded commit 55478ab
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
20 changes: 18 additions & 2 deletions src/Java2Dotnet.Spider.Common/RedisServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1653,13 +1653,29 @@ internal void HashSetMany(string key, Dictionary<string, string> values)
}

List<string> arguments = new List<string>();
arguments.Add(key);


int i = 0;
foreach (var entry in values)
{
if (i == 0)
{
arguments.Add(key);
}
else if (i == 10000)
{
SendExpectSuccess("HMSET", arguments);
arguments.Clear();
i = 0;
}
arguments.Add(entry.Key);
arguments.Add(entry.Value);
}
SendExpectSuccess("HMSET", arguments);

if (i > 0)
{
SendExpectSuccess("HMSET", arguments);
}
}
}

Expand Down
14 changes: 0 additions & 14 deletions src/Java2Dotnet.Spider.Extension/Configuration/PrepareStartUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ public class Column

public string OrderBy { get; set; }

public string EncodingName { get; set; }

/// <summary>
/// 数据来源表名, 需要Schema/数据库名
/// </summary>
Expand Down Expand Up @@ -152,18 +150,6 @@ public override void Build(Site site, dynamic obj)
foreach (var formate in FormateStrings)
{
var argArray = arguments.Cast<object>().ToArray();
if (!string.IsNullOrEmpty(EncodingName))
{
for (int i =0;i<argArray.Length;++i)
{
argArray[i] =Encoding.GetEncoding(EncodingName).GetString(Encoding.Convert(Encoding.Default, Encoding.GetEncoding(EncodingName),Encoding.Default.GetBytes(argArray[i].ToString())));

if (EncodingName == "Unicode")
{
argArray[i] = argArray[i].ToString().Replace("\\", "%");
}
}
}
string tmpUrl = string.Format(formate, arguments.Cast<object>().ToArray());
site.AddStartRequest(new Request(tmpUrl, 0, data)
{
Expand Down

0 comments on commit 55478ab

Please sign in to comment.