Skip to content

Commit

Permalink
Fix for too late cache invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Jan 19, 2024
1 parent a920b6b commit 95247af
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/alire/alire-toolchains-solutions.adb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ package body Alire.Toolchains.Solutions is
return Alire.Solutions.Solution
is

Redeployed : Boolean := False;

------------------------
-- Redeploy_If_Needed --
------------------------
Expand All @@ -31,9 +29,11 @@ package body Alire.Toolchains.Solutions is

-- It must be redeployed
Put_Warning ("Tool " & Mil.TTY_Image & " is missing, redeploying...");
Redeployed := True;

Toolchains.Deploy (Index.Find (Mil.Crate, Mil.Version));

-- This tool is used immediately to be inserted in the result map,
-- so we must invalidate the cache right now.
Invalidate_Available_Cache;
end Redeploy_If_Needed;

Result : Alire.Solutions.Solution := Solution;
Expand Down Expand Up @@ -68,11 +68,6 @@ package body Alire.Toolchains.Solutions is
end if;
end loop;

if Redeployed then
Trace.Debug ("Missing tools were redeployed, invalidating cache.");
Invalidate_Available_Cache;
end if;

return Result;
end Add_Toolchain;

Expand Down

0 comments on commit 95247af

Please sign in to comment.