Commit 06722ace authored by vicotor's avatar vicotor

fix bug

parent 865fbcd9
...@@ -29,6 +29,7 @@ func main() { ...@@ -29,6 +29,7 @@ func main() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
d.Start()
if conf.Debug { if conf.Debug {
log.SetLevel(log.DebugLevel) log.SetLevel(log.DebugLevel)
...@@ -53,6 +54,7 @@ func main() { ...@@ -53,6 +54,7 @@ func main() {
for _, syncer := range syncers { for _, syncer := range syncers {
syncer.Stop() syncer.Stop()
} }
d.Stop()
log.Info("graceful shutdown completed") log.Info("graceful shutdown completed")
os.Exit(0) os.Exit(0)
......
...@@ -84,7 +84,6 @@ func New(_c *config.Config) (dao *Dao, err error) { ...@@ -84,7 +84,6 @@ func New(_c *config.Config) (dao *Dao, err error) {
func (d *Dao) Start() { func (d *Dao) Start() {
d.wg.Add(1) d.wg.Add(1)
go d.HandleTasks() go d.HandleTasks()
} }
func (d *Dao) Stop() { func (d *Dao) Stop() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment