add recover to worker
This commit is contained in:
parent
b375f8dbbc
commit
75870273bd
@ -47,10 +47,16 @@ func NewPostDealsWC(deps Deps) *PostDeals {
|
||||
func (wc *PostDeals) Start(ctx context.Context) {
|
||||
ticker := time.NewTicker(1 * time.Minute)
|
||||
defer ticker.Stop()
|
||||
defer func() {
|
||||
if v:=recover();v!=nil{
|
||||
fmt.Println("StartFetchingRecover",v)
|
||||
}
|
||||
} ()
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
fmt.Println("StartFetching")
|
||||
wc.startFetching(ctx)
|
||||
|
||||
case <-ctx.Done():
|
||||
|
Loading…
Reference in New Issue
Block a user