diff --git a/messung/motor/pruef6/sharingan/nacht.py b/messung/motor/pruef6/sharingan/nacht.py index bc064456..499098f6 100644 --- a/messung/motor/pruef6/sharingan/nacht.py +++ b/messung/motor/pruef6/sharingan/nacht.py @@ -93,7 +93,7 @@ def lauf(): if not offen and not laufend: break belegt = sum(c for _, c in laufend.values()) - if offen and belegt + kosten(offen[0]) <= FAEDEN and frei_gb() >= 20: + if offen and belegt + kosten(offen[0]) <= FAEDEN and frei_gb() >= 20 and __import__("shutil").disk_usage("D:/").free >= 3e9: j = offen[0] p = pfad(j) if os.path.exists(p): diff --git a/messung/motor/pruef6/sharingan/waechter.py b/messung/motor/pruef6/sharingan/waechter.py index 14035f07..01f5c9b5 100644 --- a/messung/motor/pruef6/sharingan/waechter.py +++ b/messung/motor/pruef6/sharingan/waechter.py @@ -15,6 +15,7 @@ SCRATCH = "D:/Projects/pokerfreak/scratch" nt = ctypes.windll.ntdll k32 = ctypes.windll.kernel32 UNTEN, OBEN = 10, 14 # GB frei: anhalten darunter, fortsetzen darueber +PLATTE_UNTEN, PLATTE_OBEN = 3, 4 # GB frei auf D: (Orchestrator 28.11.: D: lief voll) - angehalten wird, nicht abgebrochen MUSTER = ("sequenz.py", "nacht.py", "tafel_lbr") @@ -31,6 +32,11 @@ def frei_gb(): return int(o or 99) +def platte_gb(): + import shutil + return shutil.disk_usage("D:/").free / 1e9 + + def baum(ps, wurzeln): ids, neu = set(wurzeln), set(wurzeln) while neu: @@ -72,12 +78,12 @@ def main(): while True: ps = prozesse() m = meine(ps) - {os.getpid()} - g, s = frei_gb(), spielt(ps) - if (g < UNTEN or s) and m - angehalten: + g, s, pl = frei_gb(), spielt(ps), platte_gb() + if (g < UNTEN or s or pl < PLATTE_UNTEN) and m - angehalten: setze(m - angehalten, True) angehalten |= m - print(time.strftime("%H:%M"), "frei %d GB%s -> meine angehalten" % (g, ", Laeufer spielt" if s else ""), flush=True) - elif angehalten and g >= OBEN and not s: + print(time.strftime("%H:%M"), "frei %d GB, Platte %.1f GB%s -> meine angehalten" % (g, pl, ", Laeufer spielt" if s else ""), flush=True) + elif angehalten and g >= OBEN and not s and pl >= PLATTE_OBEN: setze(angehalten, False) angehalten = set() print(time.strftime("%H:%M"), "frei %d GB -> meine fortgesetzt" % g, flush=True)