debug
This commit is contained in:
parent
a7596ff33d
commit
df757e097b
@ -4,6 +4,7 @@ import (
|
|||||||
"amocrm/internal/models"
|
"amocrm/internal/models"
|
||||||
"amocrm/internal/workers_methods"
|
"amocrm/internal/workers_methods"
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/twmb/franz-go/pkg/kgo"
|
"github.com/twmb/franz-go/pkg/kgo"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
@ -36,13 +37,20 @@ func (wc *QueueUpdater) Start(ctx context.Context) {
|
|||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
func () {
|
||||||
case <-ticker.C:
|
defer func(){
|
||||||
wc.consumeMessages(ctx)
|
if v:=recover();v!=nil{
|
||||||
|
fmt.Println("queuer recover",v)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
select {
|
||||||
|
case <-ticker.C:
|
||||||
|
wc.consumeMessages(ctx)
|
||||||
|
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user