Skip to content

Commit 5e1dbbd

Browse files
committed
Shouldn't need a grace period, just include when setting the end time
1 parent 7942a7f commit 5e1dbbd

File tree

5 files changed

+2
-12
lines changed

5 files changed

+2
-12
lines changed

src/murfey/client/multigrid_control.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class MultigridController:
4949
token: str = ""
5050
_machine_config: dict = field(default_factory=lambda: {})
5151
visit_end_time: Optional[datetime] = None
52-
end_time_grace_period: int = 0
5352

5453
def __post_init__(self):
5554
if self.token:
@@ -280,7 +279,6 @@ def _start_rsyncer(
280279
do_transfer=self.do_transfer,
281280
remove_files=remove_files,
282281
end_time=self.visit_end_time,
283-
grace_period=self.end_time_grace_period,
284282
)
285283

286284
def rsync_result(update: RSyncerUpdate):

src/murfey/client/rsync.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import subprocess
1414
import threading
1515
import time
16-
from datetime import datetime, timedelta
16+
from datetime import datetime
1717
from enum import Enum
1818
from pathlib import Path
1919
from typing import Awaitable, Callable, List, NamedTuple
@@ -65,7 +65,6 @@ def __init__(
6565
required_substrings_for_removal: List[str] = [],
6666
notify: bool = True,
6767
end_time: datetime | None = None,
68-
grace_period: int = 0,
6968
):
7069
super().__init__()
7170
self._basepath = basepath_local.absolute()
@@ -80,7 +79,6 @@ def __init__(
8079
self._notify = notify
8180
self._finalised = False
8281
self._end_time = end_time
83-
self._grace_period = grace_period
8482

8583
self._skipped_files: List[Path] = []
8684

@@ -322,9 +320,7 @@ def _transfer(self, infiles: list[Path]) -> bool:
322320
files = [
323321
f
324322
for f in infiles
325-
if f.is_file()
326-
and f.stat().st_ctime
327-
< (self._end_time + timedelta(seconds=self._grace_period)).timestamp()
323+
if f.is_file() and f.stat().st_ctime < self._end_time.timestamp()
328324
]
329325
self._skipped_files.extend(set(infiles).difference(set(files)))
330326
else:

src/murfey/server/api/instrument.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ async def setup_multigrid_watcher(
130130
},
131131
"rsync_restarts": watcher_spec.rsync_restarts,
132132
"visit_end_time": session.visit_end_time,
133-
"grace_period": machine_config.grace_period,
134133
},
135134
headers={
136135
"Authorization": f"Bearer {instrument_server_tokens[session_id]['access_token']}"

src/murfey/util/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ class MachineConfig(BaseModel, extra=Extra.allow): # type: ignore
7171

7272
notifications_queue: str = "pato_notification"
7373

74-
grace_period: int = 0
75-
7674

7775
def from_file(config_file_path: Path, instrument: str = "") -> Dict[str, MachineConfig]:
7876
with open(config_file_path, "r") as config_stream:

src/murfey/util/instrument_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ class MultigridWatcherSpec(BaseModel):
1717
destination_overrides: Dict[Path, str] = {}
1818
rsync_restarts: List[str] = []
1919
visit_end_time: Optional[datetime] = None
20-
grace_period: int = 0

0 commit comments

Comments
 (0)