ddadad
This commit is contained in:
parent
0081ccf3f2
commit
ab1bce816b
|
@ -11,6 +11,7 @@ import {
|
||||||
updateCourseReviewStats,
|
updateCourseReviewStats,
|
||||||
updateParentLectureStats,
|
updateParentLectureStats,
|
||||||
} from '@server/models/post/utils';
|
} from '@server/models/post/utils';
|
||||||
|
import { updatePostViewCount } from '../models/post/utils';
|
||||||
const logger = new Logger('QueueWorker');
|
const logger = new Logger('QueueWorker');
|
||||||
export default async function processJob(job: Job<any, any, QueueJobType>) {
|
export default async function processJob(job: Job<any, any, QueueJobType>) {
|
||||||
try {
|
try {
|
||||||
|
@ -44,6 +45,12 @@ export default async function processJob(job: Job<any, any, QueueJobType>) {
|
||||||
`Updated course stats for courseId: ${courseId}, type: ${type}`,
|
`Updated course stats for courseId: ${courseId}, type: ${type}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (job.name === QueueJobType.UPDATE_POST_VISIT_COUNT) {
|
||||||
|
await updatePostViewCount(job.data.id, job.data.type);
|
||||||
|
}
|
||||||
|
if (job.name === QueueJobType.UPDATE_POST_STATE) {
|
||||||
|
await updatePostViewCount(job.data.id, job.data.type);
|
||||||
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
logger.error(
|
logger.error(
|
||||||
`Error processing stats update job: ${error.message}`,
|
`Error processing stats update job: ${error.message}`,
|
||||||
|
|
Loading…
Reference in New Issue