支持多台服务器同时执行任务+优化页面

一个定时任务可以允许多台服务器同时执行任务,优化页面关闭并刷新列表页
This commit is contained in:
georgehao
2019-04-16 23:40:07 +08:00
parent 07aff7ee72
commit 830d49ee1c
24 changed files with 391 additions and 137 deletions

View File

@@ -9,11 +9,11 @@ package controllers
import (
"github.com/astaxie/beego"
"github.com/axgle/mahonia"
"github.com/george518/PPGo_Job/libs"
"github.com/george518/PPGo_Job/models"
"strconv"
"strings"
"github.com/axgle/mahonia"
)
const (
@@ -361,4 +361,9 @@ func gbkAsUtf8(str string) string {
resStr := srcDecoder.ConvertString(str)
_, resBytes, _ := desDecoder.Translate([]byte(resStr), true)
return string(resBytes)
}
}
//任务识别码
func jobKey(taskId, serverId int) int {
return taskId*10000 + serverId
}