Skip to content

Commit 30038f8

Browse files
committed
chore: Remove eslint-disable and improve error handling in ScorePostJob
1 parent bbe1605 commit 30038f8

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

apps/cron/src/jobs/JobProgress.mts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-unused-vars */
2-
31
export abstract class Job {
42
public async runner(param?: any): Promise<void> {}
53
}

apps/cron/src/jobs/ScorePostJob.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ export class ScorePostJob extends JobProgress implements Job {
2828
const data: ScorePostQueueData = JSON.parse(item)
2929
try {
3030
await this.postService.scoreCalculator(data.post_id)
31-
} catch (error) {
31+
} catch (error: any) {
3232
console.log('ScorePostJob error', error)
33-
const message = { message: 'ScorePostJob error', payload: item, error: error }
33+
const message = { message: 'ScorePostJob error', payload: item, error: error?.message }
3434
this.discord.sendMessage('error', JSON.stringify(message))
3535
} finally {
3636
await this.redis.lpop(scorePostQueueName)

0 commit comments

Comments
 (0)