Skip to content

Commit b90ad30

Browse files
committed
check dependencies (and use db) in the last place
1 parent 0fa965d commit b90ad30

File tree

1 file changed

+9
-11
lines changed
  • static_precompiler/compilers

1 file changed

+9
-11
lines changed

static_precompiler/compilers/base.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,15 @@ def should_compile(self, source_path, from_management=False):
129129

130130
compiled_mtime = self.get_output_mtime(source_path)
131131

132-
if compiled_mtime is None:
133-
return True
134-
135-
source_mtime = self.get_source_mtime(source_path)
136-
137-
if self.supports_dependencies:
138-
for dependency in self.get_dependencies(source_path):
139-
if compiled_mtime <= self.get_source_mtime(dependency):
140-
return True
141-
142-
return compiled_mtime <= source_mtime
132+
return (
133+
compiled_mtime is None or
134+
compiled_mtime <= self.get_source_mtime(source_path) or
135+
self.supports_dependencies and
136+
any(
137+
compiled_mtime <= self.get_source_mtime(dependency)
138+
for dependency in self.get_dependencies(source_path)
139+
)
140+
)
143141

144142
def get_source(self, source_path):
145143
""" Get the source code to be compiled.

0 commit comments

Comments
 (0)