Commit 4370644
authored
Set finite OnceCache timeout for OAuth token exchange and refresh (#1142)
Waiters on Hex.OnceCache shared a hardcoded 5s default timeout while the
underlying HTTP call can take up to 15s. Under concurrent private package
fetches in :hex_fetcher this caused all but the computing task to time out
before the token exchange completed.
Use a 60s timeout consistent with Hex.Registry.Server and other HTTP-bound
GenServer calls in the codebase. Replace the :infinity timeout in
Hex.OAuth with the same bound; the interactive device flow is invoked
sequentially from check_and_refresh_auth before parallel fetches begin,
so concurrent waiters only ever cover the HTTP refresh path.1 parent 3e5dd79 commit 4370644
2 files changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | | - | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
366 | | - | |
| 367 | + | |
| 368 | + | |
367 | 369 | | |
368 | 370 | | |
369 | 371 | | |
| |||
0 commit comments