mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 06:03:09 +00:00
sort by the most recently accessed files
This commit is contained in:
parent
83291eab3a
commit
b40259096c
@ -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
|
||||
|
18
methods.py
18
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
|
||||
|
Loading…
Reference in New Issue
Block a user