feat: Add monitoring alerts skeleton and enhance worker with notifications
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using CMSMicroservice.Infrastructure.Persistence;
|
||||
using CMSMicroservice.Infrastructure.Data.Seeding;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog.Core;
|
||||
using Serilog;
|
||||
using System.Reflection;
|
||||
@@ -99,6 +101,12 @@ if (app.Environment.IsDevelopment())
|
||||
var initialiser = scope.ServiceProvider.GetRequiredService<ApplicationDbContextInitialiser>();
|
||||
await initialiser.InitialiseAsync();
|
||||
await initialiser.SeedAsync();
|
||||
|
||||
// Run Migration: ParentId → NetworkParentId (فقط یکبار اجرا میشود)
|
||||
var migrationLogger = scope.ServiceProvider.GetRequiredService<ILogger<NetworkParentIdMigrationSeeder>>();
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
|
||||
var migrationSeeder = new NetworkParentIdMigrationSeeder(dbContext, migrationLogger);
|
||||
await migrationSeeder.SeedAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -10,6 +10,19 @@
|
||||
"Otp": {
|
||||
"Secret": "K2w8k1h1mH2Qz1kqWk0c8kQ2Pq8q9H1eE2nqN1qQ8x7M="
|
||||
},
|
||||
"Monitoring": {
|
||||
"SentryEnabled": false,
|
||||
"SentryDsn": "",
|
||||
"SlackEnabled": false,
|
||||
"SlackWebhookUrl": "",
|
||||
"EmailAlertsEnabled": false,
|
||||
"AdminEmails": [
|
||||
"admin@example.com"
|
||||
],
|
||||
"SmsNotificationsEnabled": false,
|
||||
"SmsApiKey": "",
|
||||
"SmsGatewayUrl": ""
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"Kestrel": {
|
||||
"EndpointDefaults": {
|
||||
|
||||
Reference in New Issue
Block a user