Skip to content

Commit

Permalink
fix: 修复 禁用订阅后未移除定时任务的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Nov 4, 2024
1 parent 31bc9d5 commit bdf728a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/services/tasks/tasks.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export class TasksService implements OnApplicationBootstrap {
if (errorCount > MAX_ERROR_COUNT) {
feed.isEnabled = false
await this.feedRepository.save(feed)
await this.disableFeedTask(feed)
this.logger.warn(`订阅 id: ${feed.id} 错误次数已达 ${errorCount} 次,已停止订阅!`)
return
}
Expand Down Expand Up @@ -233,6 +234,7 @@ export class TasksService implements OnApplicationBootstrap {
if (errorCount > MAX_ERROR_COUNT) {
feed.isEnabled = false
await this.feedRepository.save(feed)
await this.disableFeedTask(feed)
this.logger.log(`订阅 id: ${feed.id} 已被禁用!`)
}
}
Expand Down

0 comments on commit bdf728a

Please sign in to comment.