2024-12-25 15:06:46 +08:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2024-07-15 10:31:26 +08:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
2024-12-25 15:06:46 +08:00
|
|
|
|
using Serilog;
|
|
|
|
|
|
using System.IO;
|
2024-07-15 10:31:26 +08:00
|
|
|
|
|
|
|
|
|
|
namespace RunRedis
|
|
|
|
|
|
{
|
|
|
|
|
|
public class Program
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
|
{
|
2024-12-25 15:06:46 +08:00
|
|
|
|
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD> Serilog
|
|
|
|
|
|
Log.Logger = new LoggerConfiguration()
|
|
|
|
|
|
.WriteTo.Console() // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨
|
|
|
|
|
|
.MinimumLevel.Information()
|
|
|
|
|
|
.WriteTo.File(@"D:\SOMS\Logs\RunRedislog-.txt", rollingInterval: RollingInterval.Day, retainedFileCountLimit: 7)
|
|
|
|
|
|
.CreateLogger();
|
|
|
|
|
|
Log.Information("<22>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
|
Log.Information("<22><>ǰĿ¼<C4BF><C2BC>" + Directory.GetCurrentDirectory());
|
|
|
|
|
|
var configuration = new ConfigurationBuilder()
|
|
|
|
|
|
.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), "appsettings.json"), optional: false, reloadOnChange: true)
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
var redisSetting = configuration.GetSection("RedisSetting").Get<RedisSetting>();
|
|
|
|
|
|
|
|
|
|
|
|
Worker worker = new Worker(redisSetting);
|
|
|
|
|
|
worker.ExecuteAsync().Wait();
|
2024-07-15 10:31:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-25 15:06:46 +08:00
|
|
|
|
|
2024-07-15 10:31:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|