Fix issues when discovering images

This commit is contained in:
grossmj committed 2022-06-03 15:35:33 +07:00
1 parent 466aaf5c13
commit 30f7c0ce74
3 files changed
+8 -3

No files matched your search

+2
View File
@@ -91,6 +91,8 @@ async def get_computes(app: FastAPI) -> List[dict]:
def image_filter(change: Change, path: str) -> bool:
if change == Change.added:
if path.endswith(".tmp") or path.endswith(".md5sum") or path.startswith("."):
return False
header_magic_len = 7
with open(path, "rb") as f:
image_header = f.read(header_magic_len) # read the first 7 bytes of the file