agent starting :D
This commit is contained in:
16
backend/system/settingsFeatures.controller.ts
Normal file
16
backend/system/settingsFeatures.controller.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* When a feature setting gets updated we will handle it here.
|
||||
* we will stop jobs, stop cycles
|
||||
*/
|
||||
|
||||
import type { Setting } from "../db/schema/settings.schema.js";
|
||||
import { resumeCronJob, stopCronJob } from "../utils/croner.utils.js";
|
||||
|
||||
export const featureControl = async (data: Setting) => {
|
||||
// when a feature is changed to active or deactivated we will update the cron.
|
||||
if (data.active) {
|
||||
resumeCronJob(data.name);
|
||||
} else {
|
||||
stopCronJob(data.name);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user