mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Fixed stopping main server from console
This commit is contained in:
parent
9cf1fb3ed8
commit
eb82282e58
@ -5,7 +5,7 @@ author = {
|
|||||||
"email":"maloja@krateng.dev",
|
"email":"maloja@krateng.dev",
|
||||||
"github": "krateng"
|
"github": "krateng"
|
||||||
}
|
}
|
||||||
version = 2,3,3
|
version = 2,3,4
|
||||||
versionstr = ".".join(str(n) for n in version)
|
versionstr = ".".join(str(n) for n in version)
|
||||||
links = {
|
links = {
|
||||||
"pypi":"malojaserver",
|
"pypi":"malojaserver",
|
||||||
|
@ -126,20 +126,25 @@ def stop():
|
|||||||
pid_sv = getInstanceSupervisor()
|
pid_sv = getInstanceSupervisor()
|
||||||
if pid_sv is not None:
|
if pid_sv is not None:
|
||||||
os.kill(pid_sv,signal.SIGTERM)
|
os.kill(pid_sv,signal.SIGTERM)
|
||||||
return True
|
# return True
|
||||||
|
|
||||||
else:
|
# else:
|
||||||
print("Server is not running")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# pid = getInstance()
|
|
||||||
# if pid is None:
|
|
||||||
# print("Server is not running")
|
# print("Server is not running")
|
||||||
# return False
|
# return False
|
||||||
|
|
||||||
|
|
||||||
|
pid = getInstance()
|
||||||
|
if pid is not None:
|
||||||
|
# print("Server is not running")
|
||||||
|
# return False
|
||||||
|
# pass
|
||||||
# else:
|
# else:
|
||||||
# os.kill(pid,signal.SIGTERM)
|
os.kill(pid,signal.SIGTERM)
|
||||||
# print("Maloja stopped! PID: " + str(pid))
|
# print("Maloja stopped! PID: " + str(pid))
|
||||||
|
if pid is not None or pid_sv is not None:
|
||||||
return True
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def loadlastfm(filename):
|
def loadlastfm(filename):
|
||||||
|
@ -31,7 +31,6 @@ def update():
|
|||||||
def start():
|
def start():
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(["python3","-m","maloja.server"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
p = subprocess.Popen(["python3","-m","maloja.server"],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
|
||||||
log(p,module="supervisor")
|
|
||||||
|
|
||||||
except e:
|
except e:
|
||||||
log("Error starting Maloja: " + str(e),module="supervisor")
|
log("Error starting Maloja: " + str(e),module="supervisor")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user