Skip to content

Commit

Permalink
Add tests for lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f committed Dec 10, 2023
1 parent df9510a commit 9672eba
Show file tree
Hide file tree
Showing 5 changed files with 990 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/Spago/Registry.purs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ shouldFetchRegistryRepos db = do
let staleAfter = Minutes 15.0
let (timeDiff :: Minutes) = DateTime.diff now lastRegistryFetch
let isOldEnough = timeDiff > staleAfter
if isOldEnough then do
-- We check if it's old, but also if we have it at all
registryExists <- FS.exists Paths.registryPath
if isOldEnough || not registryExists then do
logDebug "Registry is old, refreshing"
liftEffect $ Db.updateLastPull db registryKey now
pure true
Expand Down
Loading

0 comments on commit 9672eba

Please sign in to comment.