Skip to content

Commit

Permalink
Delete cached errors if all sources fail - references #908
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jun 29, 2015
1 parent ddd0ea2 commit 42ab811
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 1.18.5 - 29.06.2015
* BUGFIX: Delete cached errors if all sources fail - https://github.com/fsprojects/Paket/issues/908

#### 1.18.4 - 29.06.2015
* COSMETICS: Better error message when package doesn't exist

Expand Down
9 changes: 9 additions & 0 deletions src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ let private loadFromCacheOrOData force fileName auth nugetURL package version =
return true,details
}

let deleteErrorFile (packageName:PackageName) =
let di = DirectoryInfo(CacheFolder)
for errorFile in di.GetFiles(sprintf "*%O*.failed" packageName) do
try
File.Delete(errorFile.FullName)
with
| _ -> ()

/// Tries to get download link and direct dependencies from Nuget
/// Caches calls into json file
let getDetailsFromNuget force auth nugetURL package (version:SemVerInfo) =
Expand Down Expand Up @@ -617,6 +625,7 @@ let GetPackageDetails root force sources packageName (version:SemVerInfo) : Pack
verbosefn "Source '%O' exception: %O" source e
tryNext rest
| [] ->
deleteErrorFile packageName
match sources with
| [source] ->
failwithf "Couldn't get package details for package %s %s on %s." package (version.ToString()) (source.ToString())
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<WarningLevel>3</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<StartArguments>install</StartArguments>
<StartWorkingDirectory>D:\code\RethinkDB.Demo</StartWorkingDirectory>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>D:\code\paketkopie</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand Down

0 comments on commit 42ab811

Please sign in to comment.