This commit is contained in:
ed 2022-07-03 13:55:48 +02:00
parent 8fef9e363e
commit 40ce4e2275
2 changed files with 6 additions and 13 deletions

View file

@ -10,8 +10,7 @@ turn your phone or raspi into a portable file server with resumable uploads/down
* server only needs `py2.7` or `py3.3+`, all dependencies optional
* browse/upload with [IE4](#browser-support) / netscape4.0 on win3.11 (heh)
* *resumable* uploads need `firefox 34+` / `chrome 41+` / `safari 7+` for full speed
* code standard: `black`
* *resumable* uploads need `firefox 34+` / `chrome 41+` / `safari 7+`
try the **[read-only demo server](https://a.ocv.me/pub/demo/)** 👀 running from a basement in finland

View file

@ -1498,20 +1498,17 @@ def guess_mime(url: str, fallback: str = "application/octet-stream") -> str:
def getalive(pids: list[int], pgid: int) -> list[int]:
alive = []
for pid in pids:
if pgid:
try:
try:
if pgid:
# check if still one of ours
if os.getpgid(pid) == pgid:
alive.append(pid)
except:
pass
else:
try:
else:
# windows doesn't have pgroups; assume
psutil.Process(pid)
alive.append(pid)
except:
pass
except:
pass
return alive
@ -1551,9 +1548,6 @@ def killtree(root: int) -> None:
os.kill(pid, signal.SIGTERM)
return
if not pids:
return # yay
for n in range(10):
time.sleep(0.1)
pids = getalive(pids, pgid)