feat(web): cache dashboard aggregations with version invalidation
This commit is contained in:
1 parent
91aa3e1f95
commit
9fd277c05f
15 files changed
+399
-30
No files matched your search
@@ -176,6 +176,7 @@ class FavoriteActionService:
|
||||
aid=aid, folder_id=folder.media_id, position=position,
|
||||
already=already,
|
||||
)
|
||||
self.repo.bump_cache_version("videos")
|
||||
return ActionResult(
|
||||
ok=True, aid=aid, action="favorite", state="done",
|
||||
position=position, already_in_folder=already,
|
||||
@@ -201,6 +202,7 @@ class FavoriteActionService:
|
||||
message="候选不存在或已处理",
|
||||
)
|
||||
self.repo.mark_candidate_decision(aid, "rejected", now=self._now())
|
||||
self.repo.bump_cache_version("videos")
|
||||
return ActionResult(
|
||||
ok=True, aid=aid, action="ignore", state="rejected",
|
||||
message="已忽略",
|
||||
@@ -228,6 +230,7 @@ class FavoriteActionService:
|
||||
)
|
||||
rejected = self.repo.reject_pending_for_up(up_mid, now=self._now())
|
||||
self.repo.mark_candidate_decision(aid, "rejected", now=self._now())
|
||||
self.repo.bump_cache_version("videos")
|
||||
return ActionResult(
|
||||
ok=True, aid=aid, action="blacklist", state="rejected",
|
||||
message=f"已拉黑 UP,并忽略该 UP 的 {rejected} 条待决策候选",
|
||||
|
||||
Reference in new issue
Block a user