"""Fingerprint this worker's execution adapter at process startup.""" import hashlib from pathlib import Path def code_revision(): digest = hashlib.sha256() for path in sorted(Path(__file__).parent.glob("*.py")): digest.update(path.name.encode()) digest.update(path.read_bytes()) return digest.hexdigest()[:12]