Commit c49ad8d4 by 泽锋 李

自动下首单服务

parent 4f32ed85
using AutoTurnOver.Services; using AutoTurnOver.DB;
using AutoTurnOver.Services;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -37,6 +38,27 @@ namespace ShortagePush ...@@ -37,6 +38,27 @@ namespace ShortagePush
} }
}); });
// 每5分钟下一次首单
Task.Factory.StartNew(() => {
while (true)
{
try
{
System.Console.WriteLine($"开始下首单,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
dc_auto_first_order_sku_dao.GeneratePurchaseAdvise();
System.Console.WriteLine($"结束下首单,线程Id:{Thread.CurrentThread.ManagedThreadId}{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
Thread.Sleep(5 * 60 * 1000);
}
});
return Task.CompletedTask; return Task.CompletedTask;
} }
......
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