fix(ops): conservative post-rollout retention and deterministic disk watch
Deploy Canina / deploy (push) Has been cancelled

This commit is contained in:
devops committed 2026-10-26 04:57:33 +00:00
1 parent b4420e54b7
commit 366bc9fc88
8 files changed
+167

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
"""No-model threshold check. Exit 1 at >=85% used or <10GiB available."""
import json,os,subprocess,sys
def pressure(total,available):return available < 10*1024**3 or (total-available)/total >= .85
def main():
s=os.statvfs('/');total=s.f_blocks*s.f_frsize;available=s.f_bavail*s.f_frsize
alert=pressure(total,available)
message=json.dumps({'service':'canina-disk-watch','alert':alert,'total':total,'available':available})
print(message)
if alert:subprocess.run(['logger','-p','daemon.err','-t','canina-disk-watch',message],check=True)
return int(alert)
if __name__=='__main__':sys.exit(main())