Skip to content

Commit

Permalink
fix: 修复归档进行中时,无法恢复文件。 TencentBlueKing#1989
Browse files Browse the repository at this point in the history
  • Loading branch information
felixncheng authored Apr 9, 2024
1 parent 6126ef8 commit da38adf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class FileCoreProcessor(
* 从db中按时间逆序,获取待归档文件
* */
private fun requestArchiveFile(request: Long) {
if (request <= 0 || archiveFileQueue.size > 0 || closed.get()) {
if (request <= 0 || closed.get()) {
return
}
logger.info("Request $request files to archive or restore.")
Expand All @@ -143,7 +143,7 @@ class FileCoreProcessor(
.limit(req)
reactiveMongoTemplate.find(query, TArchiveFile::class.java).collectList().zipWhen {
val remain = req - it.size
if (remain > 0) {
if (remain > 0 && archiveFileQueue.isEmpty()) {
val query2 = Query.query(where(TArchiveFile::status).isEqualTo(ArchiveStatus.CREATED))
.with(Sort.by(Sort.Direction.DESC, TArchiveFile::lastModifiedDate.name))
.limit(remain)
Expand Down

0 comments on commit da38adf

Please sign in to comment.