mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
自动更新缓存任务执行状况/优化缓存相关文字提示
This commit is contained in:
@@ -16,7 +16,7 @@ func init() {
|
||||
GetPost("", new(IndexAction)).
|
||||
GetPost("/fetch", new(FetchAction)).
|
||||
Get("/tasks", new(TasksAction)).
|
||||
Get("/task", new(TaskAction)).
|
||||
GetPost("/task", new(TaskAction)).
|
||||
Post("/deleteTask", new(DeleteTaskAction)).
|
||||
Post("/resetTask", new(ResetTaskAction)).
|
||||
EndAll()
|
||||
|
||||
@@ -29,14 +29,32 @@ func (this *TaskAction) RunGet(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
taskResp, err := this.RPC().HTTPCacheTaskRPC().FindEnabledHTTPCacheTask(this.AdminContext(), &pb.FindEnabledHTTPCacheTaskRequest{HttpCacheTaskId: params.TaskId})
|
||||
if !this.readTask(params.TaskId) {
|
||||
return
|
||||
}
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *TaskAction) RunPost(params struct {
|
||||
TaskId int64
|
||||
}) {
|
||||
if !this.readTask(params.TaskId) {
|
||||
return
|
||||
}
|
||||
this.Success()
|
||||
}
|
||||
|
||||
// 读取任务信息
|
||||
func (this *TaskAction) readTask(taskId int64) (ok bool) {
|
||||
taskResp, err := this.RPC().HTTPCacheTaskRPC().FindEnabledHTTPCacheTask(this.AdminContext(), &pb.FindEnabledHTTPCacheTaskRequest{HttpCacheTaskId: taskId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
var task = taskResp.HttpCacheTask
|
||||
if task == nil {
|
||||
this.NotFound("HTTPCacheTask", params.TaskId)
|
||||
this.NotFound("HTTPCacheTask", taskId)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -101,5 +119,6 @@ func (this *TaskAction) RunGet(params struct {
|
||||
"user": userMap,
|
||||
}
|
||||
|
||||
this.Show()
|
||||
ok = true
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user