fix: issues

This commit is contained in:
Rogee
2024-09-05 19:09:20 +08:00
parent 1a628f7e96
commit 1adb3a6b04

View File

@@ -6,6 +6,7 @@ import (
"time"
"exporter/config"
"exporter/pkg/errorx"
"github.com/pkg/errors"
"github.com/spf13/cobra"
@@ -52,6 +53,9 @@ func channelExportCmd(ctx context.Context) error {
for {
if err := client.Channel(ctx, channel, cfg, false); err != nil {
logger.Error("failed to export channel", zap.Error(err), zap.Int64("uuid", channel.GetID()))
if errors.Is(err, errorx.ErrNoNewMessage) {
break
}
continueRetryTimes++
if continueRetryTimes > 6 {
return err
@@ -64,4 +68,5 @@ func channelExportCmd(ctx context.Context) error {
continueRetryTimes = 0
}
return nil
}