This repository was archived by the owner on Jul 10, 2026. It is now read-only.
Commit c8f66e0
Loom Agent
fix(async_subtensor): don't close shared connection in register methods
register, burned_register and register_limit used `async with self:`, whose
__aexit__ calls self.substrate.close(). On a long-lived, shared subtensor this
closed the caller's websocket as soon as the method returned, breaking every
subsequent query. Every other async method already assumes an open connection
and leaves it open; these three were the only outliers.
Add an _ensure_connection async-context helper that initializes the substrate
without closing it, and use it in place of `async with self:`.1 parent b9af04a commit c8f66e0
2 files changed
Lines changed: 42 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
361 | 375 | | |
362 | 376 | | |
363 | 377 | | |
| |||
7216 | 7230 | | |
7217 | 7231 | | |
7218 | 7232 | | |
7219 | | - | |
| 7233 | + | |
7220 | 7234 | | |
7221 | 7235 | | |
7222 | 7236 | | |
| |||
8507 | 8521 | | |
8508 | 8522 | | |
8509 | 8523 | | |
8510 | | - | |
| 8524 | + | |
8511 | 8525 | | |
8512 | 8526 | | |
8513 | 8527 | | |
| |||
8586 | 8600 | | |
8587 | 8601 | | |
8588 | 8602 | | |
8589 | | - | |
| 8603 | + | |
8590 | 8604 | | |
8591 | 8605 | | |
8592 | 8606 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
197 | 222 | | |
198 | 223 | | |
199 | 224 | | |
| |||
0 commit comments