Fas 2 steg 3: Household Trust Score (admin + i18n status i appen)
This commit is contained in:
@@ -210,7 +210,7 @@ async function registerRepeatableJobs() {
|
||||
);
|
||||
await queue.upsertJobScheduler(
|
||||
"scheduler-trust",
|
||||
{ every: 300_000 },
|
||||
{ every: 6 * 60 * 60 * 1000 }, // var 6:e timme; decay lever på dygnsskala
|
||||
{ name: "UPDATE_TRUST_STATES", data: { jobType: "UPDATE_TRUST_STATES" }, opts: baseOpts },
|
||||
);
|
||||
await queue.upsertJobScheduler(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { and, eq, gt, inArray, isNull, lte, sql } from "drizzle-orm";
|
||||
import { and, asc, eq, gt, inArray, isNull, lte, sql } from "drizzle-orm";
|
||||
import { schema } from "@app/database";
|
||||
import { classifyExpiry, computeTrust } from "@app/inventory-engine";
|
||||
import { deriveMemoryUpdates } from "@app/memory-client";
|
||||
@@ -57,6 +57,7 @@ export async function processTrustDecay(ctx: WorkerContext): Promise<number> {
|
||||
.select()
|
||||
.from(schema.inventoryItems)
|
||||
.where(and(isNull(schema.inventoryItems.depletedAt), gt(schema.inventoryItems.quantity, 0)))
|
||||
.orderBy(asc(schema.inventoryItems.updatedAt))
|
||||
.limit(500);
|
||||
|
||||
let updated = 0;
|
||||
|
||||
Reference in New Issue
Block a user