fix: only include finished crawls in crawlCount value for /api/crawlconfigs (#746)

This commit is contained in:
Ilya Kreymer 2023-04-04 19:50:14 -07:00 committed by GitHub
parent 88497d2a64
commit 67172ca1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -503,8 +503,6 @@ class CrawlConfigOps:
"as": "configCrawls",
},
},
# Set crawl count
{"$set": {"crawlCount": {"$size": "$configCrawls"}}},
# Filter workflow crawls on finished and active
{
"$set": {
@ -522,6 +520,8 @@ class CrawlConfigOps:
}
}
},
# Set crawl count to number of finished crawls
{"$set": {"crawlCount": {"$size": "$finishedCrawls"}}},
# Sort finished crawls by finished time descending to get latest
{
"$set": {