fix linter errors 🙄
This commit is contained in:
parent
a9e1e9b1b4
commit
f97720ac67
2
kill.py
2
kill.py
|
@ -24,7 +24,7 @@ def main():
|
||||||
if body["groupname"] == "concierge":
|
if body["groupname"] == "concierge":
|
||||||
try:
|
try:
|
||||||
pidfile = open('/run/supervisor.pid', 'r')
|
pidfile = open('/run/supervisor.pid', 'r')
|
||||||
pid = int(pidfile.readline());
|
pid = int(pidfile.readline())
|
||||||
os.kill(pid, signal.SIGQUIT)
|
os.kill(pid, signal.SIGQUIT)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
write_stdout('could not kill supervisor: %s\n' % e.strerror)
|
write_stdout('could not kill supervisor: %s\n' % e.strerror)
|
||||||
|
|
5
main.py
5
main.py
|
@ -28,6 +28,7 @@ interval = 2
|
||||||
# runtime stuff
|
# runtime stuff
|
||||||
claims = []
|
claims = []
|
||||||
|
|
||||||
|
|
||||||
def svd_update():
|
def svd_update():
|
||||||
try:
|
try:
|
||||||
r = svd.supervisor.reloadConfig()
|
r = svd.supervisor.reloadConfig()
|
||||||
|
@ -88,7 +89,7 @@ def stop_task(uuid):
|
||||||
file = '/app/tasks.d/%s.conf' % uuid
|
file = '/app/tasks.d/%s.conf' % uuid
|
||||||
try:
|
try:
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
except:
|
except: # noqa
|
||||||
print('error deleting task configfile', file)
|
print('error deleting task configfile', file)
|
||||||
|
|
||||||
# reload supervisord config
|
# reload supervisord config
|
||||||
|
@ -104,6 +105,7 @@ def release_task(uuid):
|
||||||
|
|
||||||
stop_task(uuid)
|
stop_task(uuid)
|
||||||
|
|
||||||
|
|
||||||
def claim_task(uuid):
|
def claim_task(uuid):
|
||||||
global claims
|
global claims
|
||||||
r = requests.post('%s/claim/%s' % (base_url, uuid)).json()
|
r = requests.post('%s/claim/%s' % (base_url, uuid)).json()
|
||||||
|
@ -151,7 +153,6 @@ def loop(config):
|
||||||
claim_task(task.get('uuid'))
|
claim_task(task.get('uuid'))
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
time.sleep(interval)
|
time.sleep(interval)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue