diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-12-19 07:50:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 07:50:11 +0100 |
commit | b068961c8fe51daa388cfd14021712b00fd9aec7 (patch) | |
tree | ffde6ebc0637968bb5d7fda4036de482e2a89fe2 | |
parent | 062724f9ae84194bc5ca4fa95d134acc22695375 (diff) | |
parent | b40259096c70a4d05695bf2fd0eac9a395f17f93 (diff) |
Merge pull request #14815 from rraallvv/cache
Purge larger files faster from SCons cache (master)
-rw-r--r-- | SConstruct | 6 | ||||
-rw-r--r-- | methods.py | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/SConstruct b/SConstruct index ad6b6ee445..88cd1494f1 100644 --- a/SConstruct +++ b/SConstruct @@ -557,9 +557,9 @@ class cache_progress: # decay since the ctime, and return a list with the entries # (filename, size, weight). current_time = time.time() - file_stat = [(x[0], x[1][0], x[1][0] * math.exp(self.exponent_scale * (x[1][1] - current_time))) for x in file_stat] - # Sort by highest weight (most sensible to keep) first - file_stat.sort(key=lambda x: x[2], reverse=True) + file_stat = [(x[0], x[1][0], (current_time - x[1][1])) for x in file_stat] + # Sort by the most resently accessed files (most sensible to keep) first + file_stat.sort(key=lambda x: x[2]) # Search for the first entry where the storage limit is # reached sum, mark = 0, None diff --git a/methods.py b/methods.py index e861303e63..f9da6c8dd5 100644 --- a/methods.py +++ b/methods.py @@ -1755,16 +1755,16 @@ def precious_program(env, program, sources, **args): return program def add_shared_library(env, name, sources, **args): - library = env.SharedLibrary(name, sources, **args) - env.NoCache(library) - return library + library = env.SharedLibrary(name, sources, **args) + env.NoCache(library) + return library def add_library(env, name, sources, **args): - library = env.Library(name, sources, **args) - env.NoCache(library) - return library + library = env.Library(name, sources, **args) + env.NoCache(library) + return library def add_program(env, name, sources, **args): - program = env.Program(name, sources, **args) - env.NoCache(program) - return program + program = env.Program(name, sources, **args) + env.NoCache(program) + return program |