Skip to content

Commit

Permalink
feat: 增加异常捕获,并调整日志级别 TencentBlueKing#2335
Browse files Browse the repository at this point in the history
  • Loading branch information
zacYL committed Jul 4, 2024
1 parent b1cbe24 commit 3088edd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ abstract class BatchJob<C : JobContext>(open val batchJobProperties: BatchJobPro
)
SpringContextUtils.publishEvent(event)
} catch (e: Exception) {
logger.info("Job[${getJobName()}] execution failed.", e)
logger.error("Job[${getJobName()}] execution failed.", e)
} finally {
inProcess = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ class EmptyFolderCleanup(
} else {
update.set(SIZE, 0).set(NODE_NUM, 0)
}
mongoTemplate.updateFirst(query, update, collectionName)
try {
mongoTemplate.updateFirst(query, update, collectionName)
} catch (e: Exception) {
logger.error("delete $objectId failed, error: $e")
}
}

/**
Expand Down

0 comments on commit 3088edd

Please sign in to comment.