diff --git a/internal/web/actions/default/servers/components/cache/preheat.go b/internal/web/actions/default/servers/components/cache/preheat.go index e4ee2b04..557a2d98 100644 --- a/internal/web/actions/default/servers/components/cache/preheat.go +++ b/internal/web/actions/default/servers/components/cache/preheat.go @@ -57,6 +57,9 @@ func (this *PreheatAction) RunPost(params struct { Must *actions.Must }) { + // 创建日志 + defer this.CreateLog(oplogs.LevelInfo, "预热缓存,缓存策略:%d", params.CachePolicyId) + // 记录clusterId this.AddCookie(&http.Cookie{ Name: "cache_cluster_id", @@ -111,8 +114,5 @@ func (this *PreheatAction) RunPost(params struct { this.Data["isAllOk"] = isAllOk this.Data["results"] = results - // 创建日志 - defer this.CreateLog(oplogs.LevelInfo, "预热缓存,缓存策略:%d", params.CachePolicyId) - this.Success() } diff --git a/internal/web/actions/default/servers/components/cache/purge.go b/internal/web/actions/default/servers/components/cache/purge.go index 9cd0caf8..809d1dff 100644 --- a/internal/web/actions/default/servers/components/cache/purge.go +++ b/internal/web/actions/default/servers/components/cache/purge.go @@ -56,6 +56,9 @@ func (this *PurgeAction) RunPost(params struct { Keys string Must *actions.Must }) { + // 创建日志 + defer this.CreateLog(oplogs.LevelInfo, "删除缓存,缓存策略:%d", params.CachePolicyId) + // 记录clusterId this.AddCookie(&http.Cookie{ Name: "cache_cluster_id", @@ -110,8 +113,5 @@ func (this *PurgeAction) RunPost(params struct { this.Data["isAllOk"] = isAllOk this.Data["results"] = results - // 创建日志 - defer this.CreateLog(oplogs.LevelInfo, "删除缓存,缓存策略:%d", params.CachePolicyId) - this.Success() }