-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
62 changed files
with
399 additions
and
97 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<WarningsAsErrors>true</WarningsAsErrors> | ||
<CodeAnalysisRuleSet>..\coding.ruleset</CodeAnalysisRuleSet> | ||
--> | ||
<PropertyGroup> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
<WarningsAsErrors>false</WarningsAsErrors> | ||
<CodeAnalysisRuleSet>$(SolutionDir)coding.ruleset</CodeAnalysisRuleSet> | ||
|
||
<Authors>COLID team</Authors> | ||
<Company>Bayer AG</Company> | ||
</PropertyGroup> | ||
|
||
<!--<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.3" /> | ||
</ItemGroup>--> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0" /> | ||
</ItemGroup> | ||
</Project> |
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
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
36 changes: 36 additions & 0 deletions
36
src/COLID.Scheduler.Jobs/Implementation/BrokenContactNotificationJob.cs
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 System.Threading; | ||
using System.Threading.Tasks; | ||
using COLID.Scheduler.Services.Interfaces; | ||
using Hangfire; | ||
using Microsoft.Extensions.Logging; | ||
using COLID.Scheduler.Common.Constants; | ||
using COLID.Scheduler.Jobs.Interfaces; | ||
|
||
namespace COLID.Scheduler.Jobs.Implementation | ||
{ | ||
public class BrokenContactNotificationJob : IBrokenContactNotificationJob | ||
{ | ||
private readonly IBackgroundJobClient _backgroundJobClient; | ||
private readonly ILogger<BrokenContactNotificationJob> _logger; | ||
private readonly IRemoteRegistrationService _registrationService; | ||
|
||
public BrokenContactNotificationJob(IBackgroundJobClient backgroundJobClient, ILogger<BrokenContactNotificationJob> logger, IRemoteRegistrationService registrationService) | ||
{ | ||
_backgroundJobClient = backgroundJobClient; | ||
_logger = logger; | ||
_registrationService = registrationService; | ||
} | ||
|
||
[Queue(Queue.Beta)] | ||
public async Task ExecuteAsync(CancellationToken token) | ||
{ | ||
_backgroundJobClient.Enqueue<IBrokenContactNotificationJob>(x => x.CheckDataStewardsAndDistributionEndpointContactsAndNotifyUsers()); | ||
_logger.LogInformation("CheckInvalidContacts Job Finished"); | ||
} | ||
|
||
public async Task CheckDataStewardsAndDistributionEndpointContactsAndNotifyUsers() | ||
{ | ||
await _registrationService.CheckDataStewardsAndDistributionEndpointContactsAndNotifyUsers(); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/COLID.Scheduler.Jobs/Implementation/BrokenEndpointNotificationJob.cs
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,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Hangfire; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using COLID.SchedulerService.Jobs.Interfaces; | ||
using Microsoft.Extensions.Logging; | ||
using COLID.Scheduler.Common.Constants; | ||
using COLID.Scheduler.Services.Interfaces; | ||
|
||
namespace COLID.SchedulerService.Jobs.Implementation | ||
{ | ||
class BrokenEndpointNotificationJob : IBrokenEndpointNotificationJob | ||
{ | ||
private readonly IBackgroundJobClient _backgroundJobClient; | ||
private readonly ILogger<BrokenEndpointNotificationJob> _logger; | ||
private readonly IRemoteRegistrationService _registrationService; | ||
|
||
public BrokenEndpointNotificationJob(IBackgroundJobClient backgroundJobClient, ILogger<BrokenEndpointNotificationJob> logger, IRemoteRegistrationService registrationService) | ||
{ | ||
_backgroundJobClient = backgroundJobClient; | ||
_logger = logger; | ||
_registrationService = registrationService; | ||
} | ||
|
||
[Queue(Queue.Beta)] | ||
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously | ||
public async Task ExecuteAsync(CancellationToken token) | ||
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously | ||
{ | ||
_backgroundJobClient.Enqueue<IBrokenEndpointNotificationJob>(x => x.NotifyUsersForInvalidDistributionEndpoints()); | ||
_logger.LogInformation("InvalidDitributionEndpointNotification Job Finished"); | ||
} | ||
|
||
public void NotifyUsersForInvalidDistributionEndpoints() | ||
{ | ||
_logger.LogInformation("Calling registration api for to check the invalid distribution endpoint(s)"); | ||
_registrationService.CheckDistributionEndpointValidityAndNotifyUsersAsync(); | ||
} | ||
} | ||
} |
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
40 changes: 40 additions & 0 deletions
40
src/COLID.Scheduler.Jobs/Implementation/InvalidContactNotificationJob.cs
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,40 @@ | ||
using System; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using COLID.Scheduler.Services.Interfaces; | ||
using COLID.SchedulerService.Jobs.Implementation; | ||
using COLID.SchedulerService.Jobs.Interfaces; | ||
using Hangfire; | ||
using Microsoft.Extensions.Logging; | ||
using COLID.Scheduler.Common.Constants; | ||
using COLID.Scheduler.Jobs.Interfaces; | ||
|
||
namespace COLID.Scheduler.Jobs.Implementation | ||
{ | ||
public class InvalidContactNotificationJob : IInvalidContactNotificationJob | ||
{ | ||
private readonly IBackgroundJobClient _backgroundJobClient; | ||
private readonly ILogger<InvalidContactNotificationJob> _logger; | ||
private readonly IRemoteRegistrationService _registrationService; | ||
|
||
public InvalidContactNotificationJob(IBackgroundJobClient backgroundJobClient, ILogger<InvalidContactNotificationJob> logger, IRemoteRegistrationService registrationService) | ||
{ | ||
_backgroundJobClient = backgroundJobClient; | ||
_logger = logger; | ||
_registrationService = registrationService; | ||
} | ||
|
||
[Queue(Queue.Beta)] | ||
public async Task ExecuteAsync(CancellationToken token) | ||
{ | ||
_backgroundJobClient.Enqueue<IInvalidContactNotificationJob>(x => x.CheckDataStewardsAndDistributionEndpointContactsAndNotifyUsers()); | ||
_logger.LogInformation("CheckInvalidContacts Job Finished"); | ||
} | ||
|
||
public async Task CheckDataStewardsAndDistributionEndpointContactsAndNotifyUsers() | ||
{ | ||
await _registrationService.CheckDataStewardsAndDistributionEndpointContactsAndNotifyUsers(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.