-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into km/pm-15084-testing
- Loading branch information
Showing
12 changed files
with
94 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Bit.Core.Jobs; | ||
using Quartz; | ||
|
||
namespace Bit.Billing.Jobs; | ||
|
||
public class AliveJob(ILogger<AliveJob> logger) : BaseJob(logger) | ||
{ | ||
protected override Task ExecuteJobAsync(IJobExecutionContext context) | ||
{ | ||
_logger.LogInformation(Core.Constants.BypassFiltersEventId, null, "Billing service is alive!"); | ||
return Task.FromResult(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using Bit.Core.Jobs; | ||
using Bit.Core.Settings; | ||
using Quartz; | ||
|
||
namespace Bit.Billing.Jobs; | ||
|
||
public class JobsHostedService : BaseJobsHostedService | ||
{ | ||
public JobsHostedService( | ||
GlobalSettings globalSettings, | ||
IServiceProvider serviceProvider, | ||
ILogger<JobsHostedService> logger, | ||
ILogger<JobListener> listenerLogger) | ||
: base(globalSettings, serviceProvider, logger, listenerLogger) { } | ||
|
||
public override async Task StartAsync(CancellationToken cancellationToken) | ||
{ | ||
var everyTopOfTheHourTrigger = TriggerBuilder.Create() | ||
.WithIdentity("EveryTopOfTheHourTrigger") | ||
.StartNow() | ||
.WithCronSchedule("0 0 * * * ?") | ||
.Build(); | ||
|
||
Jobs = new List<Tuple<Type, ITrigger>> | ||
{ | ||
new Tuple<Type, ITrigger>(typeof(AliveJob), everyTopOfTheHourTrigger) | ||
}; | ||
|
||
await base.StartAsync(cancellationToken); | ||
} | ||
|
||
public static void AddJobsServices(IServiceCollection services) | ||
{ | ||
services.AddTransient<AliveJob>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters