Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zlzforever committed Apr 13, 2016
1 parent 5e88c07 commit d5b93fe
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
redisHost:redis_primary
redisHost:redis
redisPassword:#frAiI^MtFxh3Ks&swrnVyzAtRTq%w
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.Common/ConfigurationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ConfigurationManager

static ConfigurationManager()
{
string configPath=Directory.GetCurrentDirectory()+"/app.conf";
string configPath= Path.Combine(AppContext.BaseDirectory,"app.conf");
if (File.Exists(configPath))
{
string[] lines = File.ReadAllLines(configPath);
Expand Down
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.Common/RedisServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ private RedisResult GetResult()
redisResult.Result = msg;
return redisResult;
}
redisResult.Exeption = new Exception("Unexpected reply: ");
redisResult.Exeption = new Exception($"Unexpected reply: {redisResult.Flag} {msg}");
return redisResult;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.Core/Spider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected Spider(string identify, IPageProcessor pageProcessor, IScheduler sched

DataRootDirectory = AppDomain.CurrentDomain.BaseDirectory + "\\data\\" + Identity;
#else
DataRootDirectory = Path.Combine(Directory.GetCurrentDirectory(), Path.Combine("data", Identity));
DataRootDirectory = Path.Combine(AppContext.BaseDirectory, Path.Combine("data", Identity));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.Core/Utils/FilePersistentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected void SetPath(string path)
#if !NET_CORE
BasePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, path);
#else
BasePath = Path.Combine(Directory.GetCurrentDirectory(), path);
BasePath = Path.Combine(AppContext.BaseDirectory, path);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.Extension/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static string GetDataFilePath(ISpider spider, string name)
#if !NET_CORE
string folderPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data", spider.Identity);
#else
string folderPath = Path.Combine(Directory.GetCurrentDirectory(), "data", spider.Identity);
string folderPath = Path.Combine(AppContext.BaseDirectory, "data", spider.Identity);
#endif
if (!Directory.Exists(folderPath))
{
Expand Down
1 change: 1 addition & 0 deletions src/Java2Dotnet.Spider.Extension/ScriptSpider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ private Core.Spider PrepareSpider(params string[] args)
else
{
Console.WriteLine("No need to prepare site because other process did it.");
_spiderContext.Site.ClearStartRequests();
}

Console.WriteLine("Start creating Spider...");
Expand Down
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.JLog/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Log : ILog

static Log()
{
LogFile = Path.Combine(Directory.GetCurrentDirectory(), DateTime.Now.ToString("yyyy-MM-dd") + ".log");
LogFile = Path.Combine(AppContext.BaseDirectory, DateTime.Now.ToString("yyyy-MM-dd") + ".log");
}

public Log(string name)
Expand Down
2 changes: 1 addition & 1 deletion src/Java2Dotnet.Spider.Test/Example/JdSkuSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected override SpiderContext CreateSpiderContext()
},
Scheduler = new RedisScheduler
{
Host = "redis_primary",
Host = "redis",
Password="#frAiI^MtFxh3Ks&swrnVyzAtRTq%w",
Port = 6379
},
Expand Down
11 changes: 6 additions & 5 deletions src/MySql.Data/Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,14 @@ public virtual void Configure(MySqlConnection connection)
if (Pool != null && Settings.CacheServerProperties)
{
if (Pool.ServerProperties == null)
Pool.ServerProperties = LoadServerProperties(connection);
{
Pool.ServerProperties = LoadServerProperties(connection);
}
serverProps = Pool.ServerProperties;
}
else{
Console.WriteLine("LoadServerProperties");
serverProps = LoadServerProperties(connection);

else
{
serverProps = LoadServerProperties(connection);
}

LoadCharacterSets(connection);
Expand Down

0 comments on commit d5b93fe

Please sign in to comment.