Commit e8cda0a
authored
fix: respect explicit zero custom_after_sleep in metamorph and reboot (#971)
## Description
- `Actor.metamorph()` and `Actor.reboot()` used a falsy check on
`custom_after_sleep`, so an explicit `timedelta(0)` was treated as unset
and silently replaced with the 5-minute default
(`Configuration.metamorph_after_sleep`).
- Changed both checks to `is None`, so an explicit zero now skips the
after-sleep entirely, while omitting the argument (or passing `None`)
still uses the default.
- Added unit tests covering both methods, asserting that no sleep
happens for `timedelta(0)` and that the underlying API call is still
made.1 parent fe71bd7 commit e8cda0a
2 files changed
Lines changed: 38 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1164 | 1164 | | |
1165 | 1165 | | |
1166 | 1166 | | |
1167 | | - | |
| 1167 | + | |
1168 | 1168 | | |
1169 | 1169 | | |
1170 | 1170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
425 | 462 | | |
426 | 463 | | |
427 | 464 | | |
| |||
0 commit comments