Skip to content

Commit

Permalink
Merge pull request #552 from yarda/api-stop-method-fix
Browse files Browse the repository at this point in the history
api: fixed stop method not to require any parameter
  • Loading branch information
yarda authored Aug 22, 2023
2 parents e01ff5d + c7a3544 commit 1e33d23
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tuned/daemon/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,26 @@ def start(self, caller = None):
return False
return self._daemon.start()

@exports.export("", "b")
def stop(self, caller = None, profile_switch = False):
if caller == "":
return False
def _stop(self, profile_switch = False):
if not self._daemon.is_running():
res = True
else:
res = self._daemon.stop(profile_switch = profile_switch)
self._timer_store.cancel_all()
return res

@exports.export("", "b")
def stop(self, caller = None):
if caller == "":
return False
return self._stop(profile_switch = False)

@exports.export("", "b")
def reload(self, caller = None):
if caller == "":
return False
if self._daemon.is_running():
stop_ok = self.stop(profile_switch = True)
stop_ok = self._stop(profile_switch = True)
if not stop_ok:
return False
try:
Expand Down

0 comments on commit 1e33d23

Please sign in to comment.