diff options
| author | Paul Buetow <paul@buetow.org> | 2026-07-05 23:25:53 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-07-05 23:25:53 +0300 |
| commit | 7f6fb4b7eae994972f883384de7feed4702c1c20 (patch) | |
| tree | 36b06cfdfaf1eeba8e1ff74899535e592dd04c74 /internal/platforms/linkedin | |
| parent | f784d30559569cba63d5d02aa3413346accea7fb (diff) | |
The interactive browser login/consent flow was bounded by a 1-minute
context timeout, too short for manual credential entry and 2FA,
causing "context deadline exceeded" errors. Bumped to 5 minutes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'internal/platforms/linkedin')
| -rw-r--r-- | internal/platforms/linkedin/linkedin.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/platforms/linkedin/linkedin.go b/internal/platforms/linkedin/linkedin.go index ced242a..a9a6fef 100644 --- a/internal/platforms/linkedin/linkedin.go +++ b/internal/platforms/linkedin/linkedin.go @@ -22,6 +22,11 @@ var errUnauthorized = errors.New("unauthorized access, refresh or create token?" const linkedInTimeout = 10 * time.Second +// linkedInAuthTimeout bounds the interactive browser login/consent flow when +// (re-)authenticating, so it needs to be generous enough for manual entry of +// credentials and 2FA rather than a normal API call timeout. +const linkedInAuthTimeout = 5 * time.Minute + // addCommonHeaders applies required headers and optional LinkedIn versioning. func addCommonHeaders(req *http.Request, accessToken, liVersion string) { req.Header.Set("Authorization", "Bearer "+accessToken) @@ -51,7 +56,7 @@ func post(ctx context.Context, args config.Args, sizeLimit int, en entry.Entry) timeout := linkedInTimeout if args.Config.LinkedInAccessToken == "" { // Refreshing access token requires more time due to human interaction - timeout = 1 * time.Minute + timeout = linkedInAuthTimeout } newCtx, cancel := context.WithTimeout(ctx, timeout) defer cancel() |
