@@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
|
||||
// Retention runs internally over the same data source as the application's inbox.
|
||||
import { systemActor } from "@conusai-kit/core/worker"
|
||||
import { createConvexDataSource } from "@conusai-kit/data-convex"
|
||||
import { executorFor } from "@conusai-kit/data-convex/runtime"
|
||||
import { expireNotifications } from "@conusai-kit/notifications"
|
||||
import { internalMutation } from "./_generated/server"
|
||||
import { convexEntities, convexLive } from "./lib/runtime"
|
||||
|
||||
export const retention = internalMutation({
|
||||
args: {},
|
||||
handler: async (ctx) => {
|
||||
const data = createConvexDataSource({ entities: convexEntities, live: convexLive, executor: executorFor(ctx) })
|
||||
await expireNotifications(data, systemActor("notifications.retention"))
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user