Skip to content

Commit de1321b

Browse files
committed
Try rearranging thing so references are included in closures
1 parent c486ae4 commit de1321b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/blueapi/core/context.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ def __post_init__(self, configuration: ApplicationConfig | None):
118118
if self.numtracker is not None:
119119
numtracker = self.numtracker
120120

121+
path_provider = StartDocumentPathProvider()
122+
set_path_provider(path_provider)
123+
self.run_engine.subscribe(path_provider.update_run, "start")
124+
121125
def _update_scan_num(md: dict[str, Any]) -> int:
122126
scan = numtracker.create_scan(
123127
md["instrument_session"], md["instrument"]
@@ -127,9 +131,6 @@ def _update_scan_num(md: dict[str, Any]) -> int:
127131
return scan.scan.scan_number
128132

129133
self.run_engine.scan_id_source = _update_scan_num
130-
path_provider = StartDocumentPathProvider()
131-
set_path_provider(path_provider)
132-
self.run_engine.subscribe(path_provider.update_run, "start")
133134

134135
self.with_config(configuration.env)
135136
if self.numtracker and not isinstance(

0 commit comments

Comments
 (0)