fix(vkauth): не считать отменённый поход за реквизитами нагрузкой на провайдера
This commit is contained in:
1 parent
1547aaeed7
commit
623ef46f2f
2 files changed
+9
-3
No files matched your search
@@ -234,8 +234,11 @@ func (c *Client) fetchSerialized(ctx context.Context, link string, streamID int)
|
||||
case <-time.After(wait):
|
||||
}
|
||||
}
|
||||
defer func() { c.lastFetchTime = time.Now() }()
|
||||
return c.fetch(ctx, link, streamID)
|
||||
user, pass, addrs, err := c.fetch(ctx, link, streamID)
|
||||
if ctx.Err() == nil {
|
||||
c.lastFetchTime = time.Now()
|
||||
}
|
||||
return user, pass, addrs, err
|
||||
}
|
||||
|
||||
func (c *Client) fetch(ctx context.Context, link string, streamID int) (string, string, []string, error) {
|
||||
@@ -258,6 +261,9 @@ func (c *Client) fetch(ctx context.Context, link string, streamID int) (string,
|
||||
return user, pass, addrs, nil
|
||||
}
|
||||
lastErr = err
|
||||
if ctx.Err() != nil {
|
||||
return "", "", nil, err
|
||||
}
|
||||
c.log.Warnf("[STREAM %d] [VK Auth] Failed with client_id=%s: %v", streamID, creds.ClientID, err)
|
||||
|
||||
// Личность сменилась - тот же client_id проходится заново с чистыми
|
||||
|
||||
@@ -23,7 +23,7 @@ func (c *Client) getTokenChain(ctx context.Context, link string, streamID int, c
|
||||
|
||||
c.log.Debugf("[STREAM %d] [VK Auth] Connecting Identity - Name: %s | User-Agent: %s", streamID, name, profile.UserAgent)
|
||||
|
||||
if pageErr := c.openJoinPage(ctx, httpClient, profile, link); pageErr != nil {
|
||||
if pageErr := c.openJoinPage(ctx, httpClient, profile, link); pageErr != nil && ctx.Err() == nil {
|
||||
c.log.Warnf("[STREAM %d] [VK Auth] join page warm-up failed: %v", streamID, pageErr)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user