Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack authored and Jack committed Aug 26, 2020
1 parent 7772ff4 commit 9502ad4
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
6 changes: 3 additions & 3 deletions JMS.ServiceProvider/ScheduleTask/ScheduleTaskController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,9 @@ void run()

//转换成当天的执行时间点
DateTime time = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd " + h + ":" + m + ":00"));

_logger?.LogInformation(" {0} {1}", time , _lastRunTime);
if (DateTime.Now >= time && _lastRunTime < time)
{
_logger?.LogInformation("执行任务:{0}", taskname);
{
toRun = true;
break;
}
Expand Down Expand Up @@ -121,6 +120,7 @@ void run()

if (toRun)
{
_logger?.LogInformation("执行任务:{0}", taskname);
_lastRunTime = DateTime.Now;
this.Task.Run();
}
Expand Down
2 changes: 1 addition & 1 deletion ServiceStatusViewer/MicroServiceClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MicroServiceClient : JMSClient
static MicroServiceClient()
{
var builder = new ConfigurationBuilder();
builder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
builder.AddJsonFile(Program.SettingFileName, optional: true, reloadOnChange: true);
Configuration = builder.Build();
ConfigurationChangeCallback(null);
}
Expand Down
9 changes: 8 additions & 1 deletion ServiceStatusViewer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,25 @@
using Avalonia.ReactiveUI;
using JMS;
using Microsoft.Extensions.Configuration;
using ServiceStatusViewer.Views;
using Way.Lib;

namespace ServiceStatusViewer
{
class Program
{
public static string SettingFileName;
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
public static void Main(string[] args)
{
SettingFileName = "appsettings.json";
if (args != null && args.Length > 0)
SettingFileName = args[0];

var builder = new ConfigurationBuilder();
builder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
builder.AddJsonFile(SettingFileName, optional: true, reloadOnChange: true);
Global.Configuration = builder.Build();

//网关地址
Expand Down
8 changes: 8 additions & 0 deletions ServiceStatusViewer/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"profiles": {
"ServiceStatusViewer": {
"commandName": "Project",
"commandLineArgs": "appsettings3.json"
}
}
}
2 changes: 1 addition & 1 deletion ServiceStatusViewer/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Gateways": [ //网关地址
{
"Address": "127.0.0.1",
"Address": "47.52.0.186", //这是测试服务器的ip
"Port": 8900
}
],
Expand Down

0 comments on commit 9502ad4

Please sign in to comment.