diff --git a/internal/cmd_channel_export.go b/internal/cmd_channel_export.go index 9757b16..5751db5 100644 --- a/internal/cmd_channel_export.go +++ b/internal/cmd_channel_export.go @@ -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 }