Skip to content

Commit 67cc462

Browse files
committed
Use new '_analyse' attribute in MultigridDirWatcher class to enable/disable data processing
1 parent 28f0e22 commit 67cc462

File tree

1 file changed

+3
-5
lines changed
  • src/murfey/instrument_server

1 file changed

+3
-5
lines changed

src/murfey/instrument_server/api.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from functools import partial
88
from logging import getLogger
99
from pathlib import Path
10-
from typing import Annotated, Any, Dict, List, Optional, Union
10+
from typing import Annotated, Any, Dict, List, Optional
1111
from urllib.parse import urlparse
1212

1313
import requests
@@ -27,7 +27,7 @@
2727

2828
logger = getLogger("murfey.instrument_server.api")
2929

30-
watchers: Dict[Union[str, int], MultigridDirWatcher] = {}
30+
watchers: Dict[str | int, MultigridDirWatcher] = {}
3131
rsyncers: Dict[str, RSyncer] = {}
3232
controllers: Dict[int, MultigridController] = {}
3333
data_collection_parameters: dict = {}
@@ -190,9 +190,7 @@ def start_multigrid_watcher(session_id: MurfeySessionID, process: bool = True):
190190
if watchers.get(session_id) is None:
191191
return {"success": False}
192192
if not process:
193-
watchers[session_id]._listeners = [
194-
partial(watchers[session_id]._listeners[0], analyse=False)
195-
]
193+
watchers[session_id]._analyse = False
196194
watchers[session_id].start()
197195
return {"success": True}
198196

0 commit comments

Comments
 (0)