Compare commits

..

8 Commits

Author SHA1 Message Date
khwezi cdc373562e Merge pull request 'Updated notification service' (#22) from migration into master
Reviewed-on: #22
2026-05-17 16:07:12 +02:00
Khwezi Mngoma f299e8952a Updated notification service
continuous-integration/drone/pr Build is passing
2026-05-17 16:06:46 +02:00
khwezi c54695c390 Merge pull request 'Externalised email processor cron setting' (#21) from migration into master
Reviewed-on: #21
2026-05-16 00:43:16 +02:00
Khwezi Mngoma c47fef80b3 Externalised email processor cron setting
continuous-integration/drone/pr Build is passing
2026-05-16 00:42:47 +02:00
khwezi e2d2009cac Merge pull request 'Fixed email sending logic' (#20) from migration into master
Reviewed-on: #20
2026-05-16 00:33:04 +02:00
Khwezi Mngoma 53b422433c Fixed email sending logic
continuous-integration/drone/pr Build is passing
2026-05-16 00:32:22 +02:00
khwezi 3769bb5bae Merge pull request 'Adjusted misfire threshold to 2min' (#19) from migration into master
Reviewed-on: #19
2026-05-15 22:32:01 +02:00
Khwezi Mngoma 547f8dd229 Adjusted misfire threshold to 2min
continuous-integration/drone/pr Build is passing
2026-05-15 22:31:38 +02:00
5 changed files with 22 additions and 9 deletions
@@ -17,11 +17,12 @@
<!-- Lite Charms Libraries --> <!-- Lite Charms Libraries -->
<ItemGroup> <ItemGroup>
<PackageReference Include="LiteCharms.Features" Version="1.26.0" /> <PackageReference Include="LiteCharms.Features" Version="1.34.0" />
</ItemGroup> </ItemGroup>
<!-- Shared Global Usings --> <!-- Shared Global Usings -->
<ItemGroup> <ItemGroup>
<Using Include="Quartz" /> <Using Include="Quartz" />
<Using Include="Mediator" />
</ItemGroup> </ItemGroup>
</Project> </Project>
+6 -3
View File
@@ -1,12 +1,15 @@
using LiteCharms.Features.Extensions; using LiteCharms.Features.Extensions;
using LiteCharms.Features.Mediator; using LiteCharms.Features.Mediator;
using LiteCharmsScheduler.Workers; using LiteCharmsScheduler.Workers;
using Mediator;
using static LiteCharms.Features.Email.Extensions.Constants; using static LiteCharms.Features.Email.Extensions.Constants;
var builder = Host.CreateApplicationBuilder(args); var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddMediator(); builder.Services.AddMediator(options => options.Assemblies = new List<AssemblyReference>
{
typeof(Program).Assembly,
typeof(LiteCharms.Features.Shop.Notifications.Events.ProcessEmailNotificationsEvent).Assembly
}.AsReadOnly());
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>)); builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>)); builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
@@ -16,7 +19,7 @@ builder.Services.AddEmailServiceBus();
builder.Services.AddSalesServiceBus(); builder.Services.AddSalesServiceBus();
builder.Services.AddGeneralServiceBus(); builder.Services.AddGeneralServiceBus();
builder.Services.AddQuartzSchedulerClient(ShopSchedulerName, builder.Configuration); builder.Services.AddQuartzScheduler(ShopSchedulerName, builder.Configuration);
builder.Services.AddShopServices(); builder.Services.AddShopServices();
builder.Services.AddShopDatabase(builder.Configuration); builder.Services.AddShopDatabase(builder.Configuration);
+8 -2
View File
@@ -3,11 +3,17 @@ using LiteCharms.Features.Shop.Notifications.Events;
namespace LiteCharmsScheduler.Workers namespace LiteCharmsScheduler.Workers
{ {
public class JobWorker(IJobOrchestrator jobOrchestrator, ILogger<JobWorker> logger) : BackgroundService public class JobWorker(IJobOrchestrator jobOrchestrator, ILogger<JobWorker> logger, IConfiguration configuration) : BackgroundService
{ {
protected override async Task ExecuteAsync(CancellationToken stoppingToken) protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{ {
await jobOrchestrator.ScheduleAsync(ProcessEmailNotificationsEvent.Create(), "0 */5 * * * ?", stoppingToken); string? emailProcessorCron = !string.IsNullOrWhiteSpace(configuration.GetSection("EmailProcessorCron").Value)
? configuration.GetSection("EmailProcessorCron").Value
: "0 */4 * * * ?";
var emailProcessorJob = ProcessEmailNotificationsEvent.Create();
await jobOrchestrator.ScheduleAsync(emailProcessorJob, emailProcessorCron!, stoppingToken);
logger.LogInformation("Startup jobs scheduled"); logger.LogInformation("Startup jobs scheduled");
} }
+3 -1
View File
@@ -7,6 +7,7 @@
"Host": "mail.litecharms.co.za", "Host": "mail.litecharms.co.za",
"UseSsl": true "UseSsl": true
}, },
"EmailProcessorCron": "0 */5 * * * ?",
"Monitoring": { "Monitoring": {
"ApiKey": "", "ApiKey": "",
"Address": "http://aspire-dashboard-service.aspire.svc.cluster.local:18889", "Address": "http://aspire-dashboard-service.aspire.svc.cluster.local:18889",
@@ -15,7 +16,8 @@
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",
"Microsoft.AspNetCore": "Warning" "Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Warning"
} }
}, },
"AllowedHosts": "*" "AllowedHosts": "*"
+3 -2
View File
@@ -17,6 +17,7 @@ data:
Email__Host: "mail.litecharms.co.za" Email__Host: "mail.litecharms.co.za"
Email__Port: "465" Email__Port: "465"
Email__UseSsl: "true" Email__UseSsl: "true"
EmailProcessorCron: "0 */5 * * * ?"
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@@ -51,7 +52,7 @@ metadata:
namespace: litecharms-scheduler-uat namespace: litecharms-scheduler-uat
spec: spec:
serviceName: "scheduler-worker-service" serviceName: "scheduler-worker-service"
replicas: 3 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: scheduler app: scheduler
@@ -74,7 +75,7 @@ spec:
envFrom: envFrom:
- configMapRef: - configMapRef:
name: scheduler-config name: scheduler-config
env: env:
- name: Email__Credentials__Password - name: Email__Credentials__Password
valueFrom: valueFrom:
secretKeyRef: secretKeyRef: