feat(nodes): exclude small XrayR hosts and use registered credential fields

This commit is contained in:
hellcat committed 2026-10-20 16:24:46 +08:00
1 parent 4d667f37b2
commit d331f45b0e
9 files changed
+117 -3

No files matched your search

+7
View File
@@ -31,6 +31,13 @@ def snapshot(nodes):
return sorted(result, key=lambda n: n['id'])
def candidate_eligibility(total_memory_bytes, xrayr_installed):
"""Use physical MemTotal, excluding swap and currently free memory. 1 GB = 10**9 bytes."""
if type(total_memory_bytes) is not int or total_memory_bytes <= 0 or type(xrayr_installed) is not bool:
raise ValueError('Unknown candidate memory or XrayR installation')
return not (total_memory_bytes < 1_000_000_000 and xrayr_installed)
def validate_impact(impact):
if impact is None:
return