catch sync reading progress query error

This commit is contained in:
Hongbo Wu
2024-06-12 17:06:43 +08:00
parent fc5b152c43
commit a580fd7ebf
2 changed files with 7 additions and 3 deletions

View File

@ -6,8 +6,8 @@ import {
fetchCachedReadingPositionsAndMembers,
reduceCachedReadingPositionMembers,
} from '../services/cached_reading_position'
import { logger } from '../utils/logger'
import { updateLibraryItemReadingProgress } from '../services/library_item'
import { logger } from '../utils/logger'
export const SYNC_READ_POSITIONS_JOB_NAME = 'sync-read-positions'
@ -86,6 +86,10 @@ export const syncReadPositionsJob = async (_data: any) => {
const updates = getSyncUpdatesIterator(redis)
for await (const value of updates) {
await syncReadPosition(value)
try {
await syncReadPosition(value)
} catch (error) {
logger.error('error syncing reading position', { error, value })
}
}
}

View File

@ -438,7 +438,7 @@ const mixHomeItems = (
// use prometheus to monitor the latency of each step
const latency = new client.Histogram({
name: 'update_home_latency',
name: 'omnivore_update_home_latency',
help: 'Latency of update home job',
labelNames: ['step'],
buckets: [0.1, 0.5, 1, 2, 5, 10],