Don't blow up on a MemoryError

My VM that re-generates the stats is now breaking on a MemoryError when trying
load the local cache.  Ignore this for now since it will fall back to querying
gerrit.

Change-Id: I151fae89d9fb9a45d72e72c5aade4cb3342b4267
This commit is contained in:
Russell Bryant 2014-02-24 14:58:59 -05:00
parent 5008559e81
commit 904e55d76c
1 changed files with 4 additions and 1 deletions

View File

@ -81,7 +81,10 @@ def get_changes(projects, ssh_user, ssh_key, only_open=False, stable='',
mtime = os.stat(pickle_fn).st_mtime
if (time.time() - mtime) <= CACHE_AGE:
with open(pickle_fn, 'r') as f:
changes = pickle.load(f)
try:
changes = pickle.load(f)
except MemoryError:
changes = None
if not changes:
while True: