From fbd1f9e1a7bb786b40dd8df3bfd1a354fb92aec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=A4=A7=E5=85=A8?= Date: Wed, 28 Jun 2017 18:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8D=E8=83=BDbee?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=AF=BB=E5=8F=96=E9=85=8D=E7=BD=AE=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crons/cron.go | 9 +++++---- main.go | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crons/cron.go b/crons/cron.go index 7439730..d53bee9 100644 --- a/crons/cron.go +++ b/crons/cron.go @@ -13,12 +13,13 @@ type RemoveCheckFunc func(e *Entry) bool // Cron keeps track of any number of entries, invoking the associated func as // specified by the schedule. It may be started, stopped, and the entries may // be inspected while running. +// Cron保持任意数量的条目的轨道,调用相关的func时间表指定。它可以被启动,停止和条目,可运行的同时进行检查。 type Cron struct { - entries []*Entry - stop chan struct{} - add chan *Entry + entries []*Entry //任务 + stop chan struct{} //停止的通道 + add chan *Entry //添加新任务的方式 remove chan RemoveCheckFunc - snapshot chan []*Entry + snapshot chan []*Entry //请求获取任务快照的方式 running bool } diff --git a/main.go b/main.go index 2dbe932..28e78db 100644 --- a/main.go +++ b/main.go @@ -13,9 +13,10 @@ const ( func init() { //初始化数据模型 + beego.LoadAppConfig("ini", "src/github.com/george518/PPGo_Job/conf/app.conf") models.Init() } func main() { beego.Run() -} +} \ No newline at end of file