Skip to content

Cache friendly name by UDID rather than globally #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Handle failing to unlink old cache files
Use a try/except to avoid killing the whole process if an unused cache file can't be removed
  • Loading branch information
thehilll committed Jul 15, 2021
commit 4855cd44d962f4a407594f871cea621c10773e90
5 changes: 4 additions & 1 deletion payload/usr/local/sal/checkin_modules/machine_checkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def get_friendly_model(serial, udid):
for cache_file in MODEL_PATH.iterdir():
# clean up any other files in dir
if cache_file != UDID_CACHE_PATH:
cache_file.unlink()
try:
cache_file.unlink()
except:
pass

if not UDID_CACHE_PATH.exists():
model = cleanup_model(query_apple_support(serial))
Expand Down