feat(config): add configurable default shutdown delay for shutdown actions
This commit is contained in:
@@ -34,6 +34,22 @@ export function buildUpsActionContext(
|
||||
};
|
||||
}
|
||||
|
||||
export function applyDefaultShutdownDelay(
|
||||
actions: IActionConfig[],
|
||||
defaultDelayMinutes: number,
|
||||
): IActionConfig[] {
|
||||
return actions.map((action) => {
|
||||
if (action.type !== 'shutdown' || action.shutdownDelay !== undefined) {
|
||||
return action;
|
||||
}
|
||||
|
||||
return {
|
||||
...action,
|
||||
shutdownDelay: defaultDelayMinutes,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function decideUpsActionExecution(
|
||||
isPaused: boolean,
|
||||
ups: IUpsActionSource,
|
||||
|
||||
Reference in New Issue
Block a user