From 2f6a0d87b11727ffc5b785edab941da9e7c96764 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Wed, 12 May 2010 00:03:30 +0000 Subject: [PATCH] gcl's caching was effectively disabled for > 1 year. Reenable it. TEST=chmod a-w .svn/gcl_info/cache/codereview.settings and see if an exception is thrown when the file is recent Review URL: http://codereview.chromium.org/2057006 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@46990 0039d316-1c4b-4281-b951-d872f2087c98 --- gcl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcl.py b/gcl.py index 7237aac27..d356da532 100755 --- a/gcl.py +++ b/gcl.py @@ -15,6 +15,7 @@ import string import subprocess import sys import tempfile +import time from third_party import upload import urllib2 @@ -131,7 +132,7 @@ def GetCachedFile(filename, max_age=60*60*24*3, use_root=False): except gclient_utils.Error: return None if (not os.path.exists(cached_file) or - os.stat(cached_file).st_mtime > max_age): + (time.time() - os.stat(cached_file).st_mtime) > max_age): dir_info = SVN.CaptureInfo(".") repo_root = dir_info["Repository Root"] if use_root: