mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
append job version to the job id
This commit is contained in:
parent
6118be3b10
commit
485caec803
3 changed files with 7 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { Job } from 'bullmq'
|
||||
import { DataSource } from 'typeorm'
|
||||
import { v4 as uuid } from 'uuid'
|
||||
import { getBackendQueue } from '../../queue-processor'
|
||||
import { getBackendQueue, JOB_VERSION } from '../../queue-processor'
|
||||
import { validateUrl } from '../../services/create_page_save_request'
|
||||
import { RssSubscriptionGroup } from '../../utils/createTask'
|
||||
import { stringToHash } from '../../utils/helpers'
|
||||
|
|
@ -136,7 +136,7 @@ export const queueRSSRefreshFeedJob = async (
|
|||
return undefined
|
||||
}
|
||||
return queue.add('refresh-feed', payload, {
|
||||
jobId: jobid,
|
||||
jobId: `${jobid}_${JOB_VERSION}`,
|
||||
priority: options.priority == 'low' ? 10 : 50,
|
||||
removeOnComplete: true,
|
||||
removeOnFail: true,
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import { CACHED_READING_POSITION_PREFIX } from './services/cached_reading_positi
|
|||
import { CustomTypeOrmLogger, logger } from './utils/logger'
|
||||
|
||||
export const QUEUE_NAME = 'omnivore-backend-queue'
|
||||
export const JOB_VERSION = 'v001'
|
||||
|
||||
let backendQueue: Queue | undefined
|
||||
export const getBackendQueue = async (): Promise<Queue | undefined> => {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import {
|
|||
UPDATE_HIGHLIGHT_JOB,
|
||||
UPDATE_LABELS_JOB,
|
||||
} from '../jobs/update_db'
|
||||
import { getBackendQueue } from '../queue-processor'
|
||||
import { getBackendQueue, JOB_VERSION } from '../queue-processor'
|
||||
import { redisDataSource } from '../redis_data_source'
|
||||
import { signFeatureToken } from '../services/features'
|
||||
import { OmnivoreAuthorizationHeader } from './auth'
|
||||
|
|
@ -691,7 +691,7 @@ export const bulkEnqueueUpdateLabels = async (data: UpdateLabelsData[]) => {
|
|||
name: UPDATE_LABELS_JOB,
|
||||
data: d,
|
||||
opts: {
|
||||
jobId: `${UPDATE_LABELS_JOB}_${d.libraryItemId}`,
|
||||
jobId: `${UPDATE_LABELS_JOB}_${d.libraryItemId}_${JOB_VERSION}`,
|
||||
attempts: 6,
|
||||
priority: 1,
|
||||
removeOnComplete: true,
|
||||
|
|
@ -715,7 +715,7 @@ export const enqueueUpdateHighlight = async (data: UpdateHighlightData) => {
|
|||
|
||||
try {
|
||||
return queue.add(UPDATE_HIGHLIGHT_JOB, data, {
|
||||
jobId: `${UPDATE_HIGHLIGHT_JOB}_${data.libraryItemId}`,
|
||||
jobId: `${UPDATE_HIGHLIGHT_JOB}_${data.libraryItemId}_${JOB_VERSION}`,
|
||||
attempts: 6,
|
||||
priority: 1,
|
||||
removeOnComplete: true,
|
||||
|
|
@ -732,7 +732,7 @@ export const enqueueBulkAction = async (data: BulkActionData) => {
|
|||
return undefined
|
||||
}
|
||||
|
||||
const jobId = `${BULK_ACTION_JOB_NAME}-${data.userId}`
|
||||
const jobId = `${BULK_ACTION_JOB_NAME}_${data.userId}_${JOB_VERSION}`
|
||||
|
||||
try {
|
||||
return queue.add(BULK_ACTION_JOB_NAME, data, {
|
||||
|
|
|
|||
Loading…
Reference in a new issue