fix(tclient): correct max retries

The original value -1 is not "inf" (if retries >= e.maxRetries)
This commit is contained in:
iyear 2025-01-25 18:46:17 +08:00
parent 8728f5633f
commit 095d6520f5

View File

@ -77,7 +77,7 @@ func New(ctx context.Context, o Options) (*telegram.Client, error) {
Device: tutil.Device,
SessionStorage: o.Session,
RetryInterval: 5 * time.Second,
MaxRetries: -1, // infinite retries
MaxRetries: 5,
DialTimeout: 10 * time.Second,
Middlewares: append(NewDefaultMiddlewares(ctx, o.ReconnectTimeout), o.Middlewares...),
Clock: tclock,