feat: Add delay until action for delay app

This commit is contained in:
Faruk AYDIN
2022-12-16 03:15:30 +03:00
committed by Ali BARIN
parent 5d9ed13003
commit cb58ab5fb7
6 changed files with 81 additions and 26 deletions

View File

@@ -8,9 +8,7 @@ import {
REMOVE_AFTER_30_DAYS_OR_150_JOBS,
REMOVE_AFTER_7_DAYS_OR_50_JOBS,
} from '../helpers/remove-job-configuration';
import delayAsMilliseconds, {
TDelayForUnit,
} from '../helpers/delay-as-milliseconds';
import delayAsMilliseconds from '../helpers/delay-as-milliseconds';
type JobData = {
flowId: string;
@@ -47,12 +45,7 @@ export const worker = new Worker(
};
if (step.appKey === 'delay') {
const { delayForUnit, delayForValue } = step.parameters;
jobOptions.delay = delayAsMilliseconds(
delayForUnit as TDelayForUnit,
Number(delayForValue)
);
jobOptions.delay = delayAsMilliseconds(step);
}
await actionQueue.add(jobName, jobPayload, jobOptions);