backend: ensure cid is a UUID, remove unneeded inactive check on crawls (#842)
* backend: ensure cid is a UUID, remove unneeded inactive check on crawls * add UUID cast to cancel only
This commit is contained in:
parent
42794cad46
commit
cf15d9c873
@ -905,7 +905,7 @@ async def update_config_crawl_stats(crawl_configs, crawls, cid: uuid.UUID):
|
|||||||
"lastCrawlSize": None,
|
"lastCrawlSize": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
match_query = {"cid": cid, "finished": {"$ne": None}, "inactive": {"$ne": True}}
|
match_query = {"cid": cid, "finished": {"$ne": None}}
|
||||||
cursor = crawls.find(match_query).sort("finished", pymongo.DESCENDING)
|
cursor = crawls.find(match_query).sort("finished", pymongo.DESCENDING)
|
||||||
results = await cursor.to_list(length=10_000)
|
results = await cursor.to_list(length=10_000)
|
||||||
if results:
|
if results:
|
||||||
|
@ -296,7 +296,7 @@ class BtrixOperator(K8sAPI):
|
|||||||
return true if db mark_finished update succeeds"""
|
return true if db mark_finished update succeeds"""
|
||||||
try:
|
try:
|
||||||
redis = await self._get_redis(redis_url)
|
redis = await self._get_redis(redis_url)
|
||||||
await self.mark_finished(redis, crawl_id, cid, status, state)
|
await self.mark_finished(redis, crawl_id, uuid.UUID(cid), status, state)
|
||||||
return True
|
return True
|
||||||
# pylint: disable=bare-except
|
# pylint: disable=bare-except
|
||||||
except:
|
except:
|
||||||
|
Loading…
Reference in New Issue
Block a user