Skip to content

Commit a8a4fbb

Browse files
committed
Fix supervisor.reload
Fixes #6170
1 parent 66fa923 commit a8a4fbb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re
413413

414414
if (result.return_code & PYEXEC_RELOAD) {
415415
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_RELOAD;
416+
// Reload immediately unless the reload is due to autoreload. In that
417+
// case, we wait below to see if any other writes occur.
418+
if (supervisor_get_run_reason() != RUN_REASON_AUTO_RELOAD) {
419+
skip_repl = true;
420+
skip_wait = true;
421+
}
416422
} else if (result.return_code == 0) {
417423
next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_SUCCESS;
418424
if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_SUCCESS) {

0 commit comments

Comments
 (0)