Stage ABI-scoped unit generations
This commit is contained in:
+6
-5
@@ -2615,8 +2615,8 @@ private:
|
||||
{
|
||||
auto artifact_start = std::chrono::steady_clock::now();
|
||||
bool artifact_exists = file_exists_host(worker.unit_wasm_path(resolved));
|
||||
bool can_serve_stale = compiler_request_can_serve_stale_artifact(context);
|
||||
if(can_serve_stale && read_request && !component_source_generation_checked)
|
||||
bool stale_policy = compiler_request_can_serve_stale_artifact(context);
|
||||
if(stale_policy && read_request && !component_source_generation_checked)
|
||||
{
|
||||
component_source_generation = compiler_source_generation(context);
|
||||
component_source_generation_checked = true;
|
||||
@@ -2629,7 +2629,7 @@ private:
|
||||
// HTTP reads may serve a complete stale artifact, so bound their graph
|
||||
// stat work; CLI and mutations always check the current graph.
|
||||
bool generation_available = component_source_generation != "";
|
||||
bool check_freshness = !can_serve_stale || !read_request ||
|
||||
bool check_freshness = !stale_policy || !read_request ||
|
||||
cached_freshness == worker.component_freshness.end() ||
|
||||
(generation_available ?
|
||||
cached_freshness->second.source_generation != component_source_generation :
|
||||
@@ -2637,13 +2637,14 @@ private:
|
||||
now - cached_freshness->second.checked_at).count() >= 1000);
|
||||
if(check_freshness)
|
||||
{
|
||||
stale = compiler_unit_needs_recompile(context, resolved, 0, can_serve_stale && read_request, true);
|
||||
stale = compiler_unit_needs_recompile(context, resolved, 0, stale_policy && read_request, true);
|
||||
worker.component_freshness[resolved] = { now, stale, component_source_generation };
|
||||
}
|
||||
else
|
||||
stale = cached_freshness->second.stale;
|
||||
}
|
||||
if(stale && can_serve_stale)
|
||||
bool can_serve_stale = stale && compiler_unit_can_serve_stale_artifact(context, resolved);
|
||||
if(stale && stale_policy)
|
||||
{
|
||||
compiler_prioritize_unit(context, resolved);
|
||||
if(!read_request)
|
||||
|
||||
Reference in New Issue
Block a user