mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +00:00
fix: invalid monthly cron execution time
Note: did additional refactoring
This commit is contained in:
committed by
Rainer Killinger
parent
80e62496f0
commit
7a9f3eaca4
@@ -61,7 +61,7 @@ function minConditionFails(minimumLength: number, total: number) {
|
||||
* @param total Number of results
|
||||
*/
|
||||
function maxConditionFails(maximumLength: number, total: number) {
|
||||
return typeof maximumLength === 'number' && maximumLength < total;
|
||||
return maximumLength < total;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ function maxConditionFails(maximumLength: number, total: number) {
|
||||
* @param total total number of results of the query
|
||||
* @param mailQueue mailQueue to execute mail actions
|
||||
*/
|
||||
export function runActions(
|
||||
function runActions(
|
||||
actions: Array<SCMonitoringLogAction | SCMonitoringMailAction>,
|
||||
watcherName: string,
|
||||
triggerName: string,
|
||||
@@ -104,7 +104,7 @@ export function runActions(
|
||||
* @param esClient elasticsearch client
|
||||
* @param mailQueue mailQueue for mail actions
|
||||
*/
|
||||
export function setUp(monitoringConfig: SCMonitoringConfiguration, esClient: Client, mailQueue: MailQueue) {
|
||||
export async function setUp(monitoringConfig: SCMonitoringConfiguration, esClient: Client, mailQueue: MailQueue) {
|
||||
|
||||
// set up Watches
|
||||
monitoringConfig.watchers.forEach((watcher) => {
|
||||
@@ -122,7 +122,7 @@ export function setUp(monitoringConfig: SCMonitoringConfiguration, esClient: Cli
|
||||
trigger.executionTime = '5 0 * * 0';
|
||||
break;
|
||||
case 'monthly':
|
||||
trigger.executionTime = '5 0 * 0 * *';
|
||||
trigger.executionTime = '5 0 1 * *';
|
||||
}
|
||||
|
||||
cron.schedule(trigger.executionTime, async () => {
|
||||
|
||||
Reference in New Issue
Block a user