Commit 4b3bbb2
refactor: hoist stale-loop comprehension into a named local
Address review feedback on the stale-lock cleanup in
AsyncAccessTokenManager._get_refresh_lock(). The list comprehension was
embedded directly in the `for` statement, which read awkwardly across the
wrapped line.
Hoist it into a named `stale_loops` local and iterate over that. This is purely
a readability change with no behavioural difference: the snapshot is still
materialized before mutating the mapping, which is what makes deleting during
iteration safe.
Note this was not a lint violation - flake8 passes on the file both before and
after the change.
Also align the async deferred-acquisition test with the naming and assertions
that PR #199 introduced for the synchronous manager, and assert explicitly that
constructing AsyncAccessTokenManager performs no credential call. The async
manager has always deferred its first acquisition, so the cold-start burst
flows through the same refresh guard as a later refresh; the test now states
that intent directly.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bb08d0ed-484d-4015-b905-3e164f68678b1 parent 76e8f0a commit 4b3bbb2
2 files changed
Lines changed: 10 additions & 3 deletions
File tree
- durabletask-azuremanaged/durabletask/azuremanaged/internal
- tests/durabletask-azuremanaged
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | | - | |
| 269 | + | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
273 | 278 | | |
274 | 279 | | |
275 | 280 | | |
| |||
0 commit comments