|
@@ -11,8 +11,15 @@ func InitTask() {
|
|
|
|
|
|
c := cron.New(cron.WithSeconds())
|
|
|
|
|
|
+
|
|
|
+ if global.CONFIG.Serve.RefreshTime == "" {
|
|
|
+
|
|
|
+
|
|
|
+ global.CONFIG.Serve.RefreshTime = "0 0 17 * * *"
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- _, err := c.AddFunc("0 0 17 * * *", services.RefreshExcel)
|
|
|
+ _, err := c.AddFunc(global.CONFIG.Serve.RefreshTime, services.RefreshExcel)
|
|
|
|
|
|
if err != nil {
|
|
|
global.LOG.Info("RefreshExcel err" + err.Error())
|
|
@@ -21,6 +28,9 @@ func InitTask() {
|
|
|
|
|
|
_, err = c.AddFunc("0 */1 * * * *", watch.ReadWatchIndexFile)
|
|
|
|
|
|
+ if err != nil {
|
|
|
+ global.LOG.Info("watch.ReadWatchIndexFile err" + err.Error())
|
|
|
+ }
|
|
|
|
|
|
c.Start()
|
|
|
|