2025-11-21 08:48:01 +08:00
|
|
|
using BLWLogProduce.Services;
|
|
|
|
|
|
|
|
|
|
namespace BLWLogProduce
|
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
|
|
|
|
|
|
// Add services to the container.
|
|
|
|
|
|
|
|
|
|
builder.Services.AddControllers();
|
|
|
|
|
builder.Services.AddHostedService<KafkaProduce>();
|
|
|
|
|
builder.Services.AddHostedService<MyTimer>();
|
|
|
|
|
|
2026-01-15 17:32:26 +08:00
|
|
|
builder.Services.AddMemoryCache((option)=> { });
|
|
|
|
|
//builder.UseOrleans(ooo =>
|
|
|
|
|
//{
|
|
|
|
|
// ooo.UseLocalhostClustering();
|
|
|
|
|
// ooo.AddRedisGrainStorage("redis-store", options =>
|
|
|
|
|
// {
|
|
|
|
|
// options.ConfigurationOptions = new StackExchange.Redis.ConfigurationOptions
|
|
|
|
|
// {
|
|
|
|
|
// EndPoints = { "127.0.0.1:6379" },
|
|
|
|
|
// AbortOnConnectFail = true,
|
|
|
|
|
// ConnectRetry = 5,
|
|
|
|
|
// ConnectTimeout = 15000,
|
|
|
|
|
// SyncTimeout = 15000
|
|
|
|
|
// };
|
|
|
|
|
// });
|
|
|
|
|
//});
|
|
|
|
|
|
2025-11-21 08:48:01 +08:00
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
// Configure the HTTP request pipeline.
|
|
|
|
|
|
|
|
|
|
app.UseHttpsRedirection();
|
|
|
|
|
|
|
|
|
|
app.UseAuthorization();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.MapControllers();
|
|
|
|
|
|
|
|
|
|
app.Run();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|