Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
168a951ad9 |
No files matched your search
@@ -13,6 +13,7 @@ import type { RssFeed } from "./jobs/rss-feeds";
|
||||
import { rssFeedsJob } from "./jobs/rss-feeds";
|
||||
import { sessionCleanupJob } from "./jobs/session-cleanup";
|
||||
import { createCronJobGroup } from "./lib";
|
||||
import {notificationsFetcherJob} from "./jobs/notifications-fetcher";
|
||||
|
||||
export const jobGroup = createCronJobGroup({
|
||||
analytics: analyticsJob,
|
||||
@@ -29,6 +30,7 @@ export const jobGroup = createCronJobGroup({
|
||||
indexerManager: indexerManagerJob,
|
||||
healthMonitoring: healthMonitoringJob,
|
||||
sessionCleanup: sessionCleanupJob,
|
||||
"notifications-fetcher": notificationsFetcherJob
|
||||
});
|
||||
|
||||
export type JobGroupKeys = ReturnType<(typeof jobGroup)["getKeys"]>[number];
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import {createCronJob} from "../lib";
|
||||
import {EVERY_HOUR} from "@homarr/cron-jobs-core/expressions";
|
||||
|
||||
export const notificationsFetcherJob = createCronJob("notifications-fetcher", EVERY_HOUR, {
|
||||
runOnStart: true
|
||||
}).withCallback(async () => {
|
||||
|
||||
});
|
||||
@@ -354,6 +354,20 @@ export const icons = sqliteTable("icon", {
|
||||
.references(() => iconRepositories.id, { onDelete: "cascade" }),
|
||||
});
|
||||
|
||||
export const notifications = sqliteTable("notifications", {
|
||||
id: text().notNull().primaryKey(),
|
||||
createdAt: int({ mode: "timestamp" }).notNull(),
|
||||
dismissAfterOneAcknowledgement: int({ mode: "boolean" }).default(false).notNull(),
|
||||
content: text().notNull()
|
||||
});
|
||||
|
||||
export const notificationsAcknowledgements = sqliteTable("notificationAcknowledgements", {
|
||||
id: text().notNull().primaryKey(),
|
||||
acknowledgedAt: int({ mode: "timestamp" }).notNull(),
|
||||
userId: text().notNull().references(() => users.id, { onDelete: "cascade" }),
|
||||
notificationId: text().notNull().references(() => notifications.id, { onDelete: "cascade" }),
|
||||
});
|
||||
|
||||
export const iconRepositories = sqliteTable("iconRepository", {
|
||||
id: text().notNull().primaryKey(),
|
||||
slug: text().notNull(),
|
||||
|
||||
@@ -2150,6 +2150,9 @@
|
||||
},
|
||||
"sessionCleanup": {
|
||||
"label": "Session Cleanup"
|
||||
},
|
||||
"notifications-fetcher": {
|
||||
"label": "Notifications fetcher"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user