1
0
Fork 0

Merge pull request #552 from yarda/api-stop-method-fix

api: fixed stop method not to require any parameter
This commit is contained in:
Jaroslav Škarvada 2023-08-22 22:39:47 +02:00 committed by GitHub
commit 1e33d23f16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,10 +122,7 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
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:
@ -133,12 +130,18 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
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: