feat(import): run catalog synchronizations as durable jobs
This commit is contained in:
1 parent
a2954e4408
commit
76f0420d64
14 files changed
+559
-801
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { drainFurnitureImports } from "../src/lib/services/furni-job-worker";
|
||||
import "./load-env";
|
||||
import { Cron } from "croner";
|
||||
import { and, eq, lt, lte, sql } from "drizzle-orm";
|
||||
@@ -268,6 +269,10 @@ async function reportWorkerHeartbeat(): Promise<void> {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
new Cron("* * * * *", () => {
|
||||
void drainFurnitureImports();
|
||||
});
|
||||
void drainFurnitureImports();
|
||||
new Cron("* * * * *", () => {
|
||||
runCatalogExport().catch((e) =>
|
||||
captureWorkerError(e, "Catalog export failed"),
|
||||
|
||||
Reference in new issue
Block a user