Commit 25ad38e5 by guanzhenshan

1

parent b7293c57
...@@ -10,18 +10,18 @@ namespace Bailun.DC.DailyItemNoProfitRate ...@@ -10,18 +10,18 @@ namespace Bailun.DC.DailyItemNoProfitRate
static async Task Main(string[] args) static async Task Main(string[] args)
{ {
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) => //var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{ //{
services.AddHostedService<Services>(); // services.AddHostedService<Services>();
}); //});
await builder.RunConsoleAsync(); //await builder.RunConsoleAsync();
//var _service = new Services(); var _service = new Services();
//var day = DateTime.Parse(DateTime.Now.AddDays(-2).ToShortDateString()); var day = DateTime.Parse(DateTime.Now.AddDays(-2).ToShortDateString());
//_service.Init(day.AddDays(-20), day); _service.Init(day.AddDays(-20), day);
//_service.OneDayItemNoProfitRate(day.AddDays(-1), day); _service.OneDayItemNoProfitRate(day.AddDays(-1), day);
} }
} }
} }
...@@ -24,11 +24,11 @@ namespace Bailun.DC.DailyItemNoProfitRate ...@@ -24,11 +24,11 @@ namespace Bailun.DC.DailyItemNoProfitRate
private void DoWork(object state) private void DoWork(object state)
{ {
var now = DateTime.Now;
var day = DateTime.Parse(now.AddDays(-2).ToShortDateString()); var day = DateTime.Parse(now.AddDays(-2).ToShortDateString());
try try
{ {
var now = DateTime.Now;
if ((now.Hour == 10 && now.Minute == 45)) //17:05启动 if ((now.Hour == 10 && now.Minute == 45)) //17:05启动
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment