Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e2d2009cac | |||
| 53b422433c | |||
| 3769bb5bae | |||
| 547f8dd229 | |||
| 13be0eab87 | |||
| 5b8b1684c4 | |||
| e19f98e7ca | |||
| 8a8ed98a91 | |||
| 4b8aecc779 |
@@ -83,6 +83,8 @@ steps:
|
||||
- mkdir -p $HOME/.kube
|
||||
- echo "$KUBE_CONFIG" > $HOME/.kube/config
|
||||
- kubectl apply -f litecharms-scheduler-uat.yml
|
||||
- sleep 10
|
||||
- kubectl rollout restart statefulset/litecharms-scheduler-uat -n litecharms-scheduler-uat
|
||||
|
||||
depends_on:
|
||||
- package
|
||||
@@ -104,6 +106,7 @@ steps:
|
||||
- mkdir -p $HOME/.kube
|
||||
- echo "$KUBE_CONFIG" > $HOME/.kube/config
|
||||
- kubectl apply -f litecharms-scheduler.yml
|
||||
- sleep 10
|
||||
- kubectl rollout restart statefulset/litecharms-scheduler -n litecharms-scheduler
|
||||
|
||||
depends_on:
|
||||
|
||||
@@ -17,11 +17,12 @@
|
||||
|
||||
<!-- Lite Charms Libraries -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="LiteCharms.Features" Version="1.25.0" />
|
||||
<PackageReference Include="LiteCharms.Features" Version="1.32.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Shared Global Usings -->
|
||||
<ItemGroup>
|
||||
<Using Include="Quartz" />
|
||||
<Using Include="Mediator" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
using LiteCharms.Features.Extensions;
|
||||
using LiteCharms.Features.Mediator;
|
||||
using LiteCharmsScheduler.Workers;
|
||||
using static LiteCharms.Features.Email.Extensions.Constants;
|
||||
|
||||
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(LoggingPipelineBehavior<,>));
|
||||
|
||||
builder.Services.AddEmailServices(builder.Configuration);
|
||||
builder.Services.AddEmailServiceBus();
|
||||
|
||||
builder.Services.AddSalesServiceBus();
|
||||
builder.Services.AddGeneralServiceBus();
|
||||
builder.Services.AddQuartzSchedulerClient(ShopSchedulerName, builder.Configuration);
|
||||
builder.Services.AddQuartzScheduler(ShopSchedulerName, builder.Configuration);
|
||||
|
||||
builder.Services.AddShopServices();
|
||||
builder.Services.AddShopDatabase(builder.Configuration);
|
||||
|
||||
@@ -5,9 +5,13 @@ namespace LiteCharmsScheduler.Workers
|
||||
{
|
||||
public class JobWorker(IJobOrchestrator jobOrchestrator, ILogger<JobWorker> logger) : BackgroundService
|
||||
{
|
||||
private const string emailProcessorCron = "0 */5 * * * ?";
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
{
|
||||
await jobOrchestrator.ScheduleAsync(ProcessEmailNotificationsEvent.Create(), "0 0/1 * * * ?", stoppingToken);
|
||||
var emailProcessorJob = ProcessEmailNotificationsEvent.Create();
|
||||
|
||||
await jobOrchestrator.ScheduleAsync(emailProcessorJob, emailProcessorCron, stoppingToken);
|
||||
|
||||
logger.LogInformation("Startup jobs scheduled");
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
"Microsoft.AspNetCore": "Warning",
|
||||
"Microsoft.EntityFrameworkCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
|
||||
@@ -51,7 +51,7 @@ metadata:
|
||||
namespace: litecharms-scheduler-uat
|
||||
spec:
|
||||
serviceName: "scheduler-worker-service"
|
||||
replicas: 3
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: scheduler
|
||||
|
||||
Reference in New Issue
Block a user