You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using NewLife.Extensions.Hosting.AgentService;
|
|
|
|
using NewLife.Log;
|
|
|
|
using WorkerSynReport;
|
|
|
|
|
|
|
|
XTrace.UseConsole();
|
|
|
|
|
|
|
|
IHost host = Host.CreateDefaultBuilder(args)
|
|
|
|
.ConfigureServices(services =>
|
|
|
|
{
|
|
|
|
|
|
|
|
services.AddScoped<IDbContextLocal>(a => new DbContextLocal("Data Source=127.0.0.1;Initial Catalog=CWSSHG;user=sa;password=123456;"));
|
|
|
|
|
|
|
|
services.AddScoped<IDbContextHttp>(a => new DbContextHttp("Data Source=192.168.202.22;Initial Catalog=CWSSHG;user=sa;password=Lanju@123;"));
|
|
|
|
|
|
|
|
|
|
|
|
services.AddHostedService<Worker>();
|
|
|
|
})
|
|
|
|
.UseAgentService(options =>
|
|
|
|
{
|
|
|
|
options.ServiceName = "报表数据";
|
|
|
|
options.DisplayName = "Worker服务测试";
|
|
|
|
options.Description = "Worker服务的应用";
|
|
|
|
})
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
await host.RunAsync();
|