diff --git a/pkg/watcher/coach.go b/pkg/watcher/coach.go index 75e9ba2..554544e 100644 --- a/pkg/watcher/coach.go +++ b/pkg/watcher/coach.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "github.com/go-resty/resty/v2" + "github.com/golang/glog" "github.com/pkg/errors" "github.com/timerzz/proxypool/pkg/proxy" "gorm.io/gorm" @@ -85,6 +86,11 @@ func (c *CoachOutlet) Restart() { } func (c *CoachOutlet) Watch() { c.ctx, c.cancel = context.WithCancel(c.fCtx) + if err := c.db.Model(&model.Product{}).Updates(map[string]interface{}{"watch": true, "orderable": false}).Error; err != nil { + glog.Errorf("watch update db err: %v", err) + err = nil + } + c.getDetail() ticker := time.NewTicker(c.cfg.Interval) defer ticker.Stop()