Skip to content

Commit 124b299

Browse files
committed
Reduce redundant commit calls
1 parent 7ba6d06 commit 124b299

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

simvue/run.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,15 @@ def _start(self, reconnect: bool = False) -> bool:
466466
self._start_time = time.time()
467467

468468
if self._sv_obj:
469+
_changed = False
469470
if self._sv_obj.status != "running":
470471
self._sv_obj.status = self._status
471-
self._sv_obj.started = self._start_time
472-
self._sv_obj.commit()
472+
_changed = True
473+
if self._user_config.run.mode == "offline":
474+
self._sv_obj.started = self._start_time
475+
_changed = True
476+
if _changed:
477+
self._sv_obj.commit()
473478

474479
if self._pid == 0:
475480
self._pid = os.getpid()

0 commit comments

Comments
 (0)