mirror of
https://github.com/rajnandan1/kener.git
synced 2026-06-23 04:10:22 +00:00
fixes
This commit is contained in:
Generated
+48
@@ -129,6 +129,7 @@
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.2.2",
|
||||
"vite-node": "^5.3.0",
|
||||
"vite-plugin-devtools-json": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -5681,6 +5682,16 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/cac": {
|
||||
"version": "6.7.14",
|
||||
"resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
|
||||
"integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001765",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001765.tgz",
|
||||
@@ -6782,6 +6793,13 @@
|
||||
"is-arrayish": "^0.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/es-module-lexer": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz",
|
||||
"integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.27.2",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz",
|
||||
@@ -9288,6 +9306,13 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/pathe": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
|
||||
"integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/pg": {
|
||||
"version": "8.17.2",
|
||||
"resolved": "https://registry.npmjs.org/pg/-/pg-8.17.2.tgz",
|
||||
@@ -13177,6 +13202,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vite-node": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-5.3.0.tgz",
|
||||
"integrity": "sha512-8f20COPYJujc3OKPX6OuyBy3ZIv2det4eRRU4GY1y2MjbeGSUmPjedxg1b72KnTagCofwvZ65ThzjxDW2AtQFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cac": "^6.7.14",
|
||||
"es-module-lexer": "^2.0.0",
|
||||
"obug": "^2.1.1",
|
||||
"pathe": "^2.0.3",
|
||||
"vite": "^7.3.1"
|
||||
},
|
||||
"bin": {
|
||||
"vite-node": "dist/cli.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/antfu"
|
||||
}
|
||||
},
|
||||
"node_modules/vite-plugin-devtools-json": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vite-plugin-devtools-json/-/vite-plugin-devtools-json-1.0.0.tgz",
|
||||
|
||||
+3
-2
@@ -34,7 +34,7 @@
|
||||
"configure": "node build.js",
|
||||
"dev": "npm-run-all --parallel devschedule development",
|
||||
"development": "vite dev",
|
||||
"devschedule": "npx tsx src/lib/server/startup.ts",
|
||||
"devschedule": "vite-node src/lib/server/startup.ts",
|
||||
"generate-readme": "node scripts/generate-readme.js",
|
||||
"migrate": "npx knex migrate:latest",
|
||||
"predev": "npm run seed",
|
||||
@@ -42,7 +42,7 @@
|
||||
"preseed": "npx knex migrate:latest",
|
||||
"prettify": "prettier --write .",
|
||||
"preview": "vite preview",
|
||||
"schedule": "npx tsx src/lib/server/startup.ts",
|
||||
"schedule": "vite-node src/lib/server/startup.ts",
|
||||
"seed": "npx knex seed:run",
|
||||
"start": "npx tsx main.ts"
|
||||
},
|
||||
@@ -88,6 +88,7 @@
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^7.2.2",
|
||||
"vite-node": "^5.3.0",
|
||||
"vite-plugin-devtools-json": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import db from "../db/db.js";
|
||||
import pkg from "rrule";
|
||||
const { RRule, rrulestr } = pkg;
|
||||
import { RRule, rrulestr } from "rrule";
|
||||
import { addDays, formatDistanceStrict } from "date-fns";
|
||||
import type {
|
||||
MaintenanceRecord,
|
||||
|
||||
@@ -38,7 +38,6 @@ export class MonitorsRepository extends BaseRepository {
|
||||
}
|
||||
|
||||
async updateMonitor(data: MonitorRecord): Promise<number> {
|
||||
console.log(">>>>>>---- monitors:40 ", data);
|
||||
return await this.knex("monitors").where({ id: data.id }).update({
|
||||
tag: data.tag,
|
||||
name: data.name,
|
||||
|
||||
@@ -329,7 +329,7 @@ export const push = async (monitor_tag: string, ts: number, status: string, opti
|
||||
//get all monitor alert configs
|
||||
const monitorAlertsConfigurations = await GetMonitorAlertConfigs({
|
||||
monitor_tag: monitor.tag,
|
||||
is_active: "YES",
|
||||
is_active: GC.YES,
|
||||
});
|
||||
if (monitorAlertsConfigurations.length === 0) {
|
||||
return;
|
||||
@@ -338,11 +338,12 @@ export const push = async (monitor_tag: string, ts: number, status: string, opti
|
||||
for (const monitorAlertConfig of monitorAlertsConfigurations) {
|
||||
const deDupId = `${monitor_tag}-${ts}-${monitorAlertConfig.id}`;
|
||||
|
||||
if (!options.deduplication) {
|
||||
options.deduplication = {
|
||||
const jobOptions: JobsOptions = {
|
||||
...options,
|
||||
deduplication: {
|
||||
id: deDupId,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
await queue.add(
|
||||
jobNamePrefix + "_" + monitor_tag,
|
||||
{
|
||||
@@ -359,7 +360,7 @@ export const push = async (monitor_tag: string, ts: number, status: string, opti
|
||||
ts,
|
||||
status,
|
||||
},
|
||||
options,
|
||||
jobOptions,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Queue, Worker, Job, type JobSchedulerTemplateOptions } from "bullmq";
|
||||
import q from "../queues/q.js";
|
||||
import db from "../db/db.js";
|
||||
import pkg from "rrule";
|
||||
const { rrulestr } = pkg;
|
||||
import { rrulestr } from "rrule";
|
||||
import { addDays } from "date-fns";
|
||||
import type { MaintenanceRecord, MaintenanceEventRecord } from "../types/db.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import figlet from "figlet";
|
||||
import { fileURLToPath } from "url";
|
||||
import version from "../version.js";
|
||||
import mainScheduler from "./schedulers/appScheduler.js";
|
||||
import maintenanceScheduler from "./schedulers/maintenanceScheduler.js";
|
||||
@@ -20,10 +19,10 @@ async function Startup(): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
// Call Startup() if not imported as a module
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
// Call Startup() when run directly (works with both tsx and vite-node)
|
||||
const isMainModule = process.argv[1]?.includes("startup") || process.argv[1]?.includes("vite-node");
|
||||
|
||||
if (process.argv[1] === __filename) {
|
||||
if (isMainModule) {
|
||||
Startup();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ import {
|
||||
GenerateMaintenanceEvents,
|
||||
isOneTimeRrule,
|
||||
} from "$lib/server/controllers/maintenanceController";
|
||||
import pkg from "rrule";
|
||||
const { rrulestr } = pkg;
|
||||
import { rrulestr } from "rrule";
|
||||
|
||||
function formatDateToISO(date: Date | string): string {
|
||||
if (date instanceof Date) {
|
||||
|
||||
@@ -10,8 +10,7 @@ import type {
|
||||
} from "$lib/types/api";
|
||||
import { GetMinuteStartTimestampUTC } from "$lib/server/tool";
|
||||
import { GenerateMaintenanceEvents, isOneTimeRrule } from "$lib/server/controllers/maintenanceController";
|
||||
import pkg from "rrule";
|
||||
const { rrulestr } = pkg;
|
||||
import { rrulestr } from "rrule";
|
||||
|
||||
function formatDateToISO(date: Date | string): string {
|
||||
if (date instanceof Date) {
|
||||
|
||||
+2
-1
@@ -30,6 +30,7 @@ export default defineConfig(({ mode }) => {
|
||||
return {
|
||||
base: viteBase,
|
||||
optimizeDeps: {
|
||||
include: ["rrule"],
|
||||
exclude: [
|
||||
"svelte-codemirror-editor",
|
||||
"codemirror",
|
||||
@@ -51,7 +52,7 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
assetsInclude: ["**/*.yaml"],
|
||||
ssr: {
|
||||
noExternal: ["svelte-sonner", "svelte-codemirror-editor"],
|
||||
noExternal: ["svelte-sonner", "svelte-codemirror-editor", "rrule"],
|
||||
},
|
||||
// Keeping this around for quick grepping/debugging.
|
||||
define: {
|
||||
|
||||
Reference in New Issue
Block a user