Add cursor to logs

This commit is contained in:
Jackson Harper
2024-11-02 11:05:40 +08:00
parent 37de640830
commit 7599bbaded

View File

@ -220,10 +220,10 @@ export const exportJob = async (jobData: ExportJobData) => {
// Pipe the archiver output to the write stream // Pipe the archiver output to the write stream
archive.pipe(writeStream) archive.pipe(writeStream)
let cursor = 0
try { try {
// fetch data from the database // fetch data from the database
const batchSize = 20 const batchSize = 20
let cursor = 0
let hasNext = false let hasNext = false
do { do {
const items = await searchLibraryItems( const items = await searchLibraryItems(
@ -266,7 +266,7 @@ export const exportJob = async (jobData: ExportJobData) => {
writeStream.on('error', reject) writeStream.on('error', reject)
}) })
logger.info('export completed', { logger.info(`export completed, exported ${cursor} items`, {
userId, userId,
}) })