feat(puchase history): purhcase history changed to long running no notification
This commit is contained in:
@@ -8,7 +8,7 @@ const newSettings: NewSetting[] = [
|
||||
// feature settings
|
||||
{
|
||||
name: "opendock_sync",
|
||||
value: "0",
|
||||
value: "15",
|
||||
active: false,
|
||||
description: "Dock Scheduling system",
|
||||
moduleName: "opendock",
|
||||
@@ -69,7 +69,7 @@ const newSettings: NewSetting[] = [
|
||||
{
|
||||
name: "purchaseMonitor",
|
||||
value: "5",
|
||||
active: false,
|
||||
active: true,
|
||||
description: "Monitors alpla purchase fo all changes",
|
||||
moduleName: "purchase",
|
||||
settingType: "feature",
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
killOpendockSocket,
|
||||
opendockSocketMonitor,
|
||||
} from "../opendock/opendockSocketMonitor.utils.js";
|
||||
import { monitorAlplaPurchase } from "../purchase/purchase.controller.js";
|
||||
import {
|
||||
createCronJob,
|
||||
resumeCronJob,
|
||||
@@ -31,8 +32,24 @@ export const featureControl = async (data: Setting) => {
|
||||
createCronJob("opendockAptCleanup", "0 30 5 * * *", () =>
|
||||
dbCleanup("opendockApt", 90),
|
||||
);
|
||||
} else {
|
||||
}
|
||||
|
||||
if (data.name === "opendock_sync" && !data.active) {
|
||||
killOpendockSocket();
|
||||
stopCronJob("opendockAptCleanup");
|
||||
}
|
||||
|
||||
// purchase stuff
|
||||
if (data.name === "purchaseMonitor" && data.active) {
|
||||
monitorAlplaPurchase();
|
||||
}
|
||||
|
||||
if (data.name === "purchaseMonitor" && !data.active) {
|
||||
stopCronJob("purchaseMonitor");
|
||||
}
|
||||
|
||||
// this means the data time has changed
|
||||
if (data.name === "purchaseMonitor" && data.value) {
|
||||
monitorAlplaPurchase();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user