From 973be732024245de740cc8f8e48cf84ce75ce9a3 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 28 Oct 2024 11:51:33 -0500 Subject: [PATCH] Switched jobs to use redis from a remote cluster. --- ving/docs/change-log.md | 3 +++ ving/jobs/queue.mjs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ving/docs/change-log.md b/ving/docs/change-log.md index 20c4b208..9c36615f 100644 --- a/ving/docs/change-log.md +++ b/ving/docs/change-log.md @@ -5,6 +5,9 @@ outline: deep ## October 2024 +### 2024-10-28 + * Switched jobs to use redis from a remote cluster. + ### 2024-10-27 * Added ego behavior to useVingRecord() and useVingKind() to allow disambiguation of multiple copies of the same record with different views. * VingRecord.propOptions() now returns validation options S3File relations in the form of acceptedFileExtensions. diff --git a/ving/jobs/queue.mjs b/ving/jobs/queue.mjs index 728a433a..b8152f0c 100644 --- a/ving/jobs/queue.mjs +++ b/ving/jobs/queue.mjs @@ -12,7 +12,7 @@ import { jobHandlers } from '#ving/jobs/map.mjs'; * getQueue(); */ export const getQueue = (options = {}) => { - const queue = new Queue(options?.queueName || 'jobs'); + const queue = new Queue(options?.queueName || 'jobs', { connection: useRedis() }); return queue; } @@ -47,7 +47,7 @@ export const addJob = async (type, data = {}, options = { queueName: 'jobs' }) = throw ving.ouch(404, `Job handler ${type} is not available.`); const queue = getQueue(options); const jobOptions = { - connection: useRedis(), + // connection: useRedis(), removeOnComplete: { age: 3600, // keep up to 1 hour count: 1000, // keep up to 1000 jobs