Skip to content

Commit

Permalink
Put feed url into cache filename - references #487
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Jan 1, 2015
1 parent 8edfd31 commit a1509e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 0.20.9 - 01.01.2015
* PERFORMANCE: Put feed url into cache filename - https://github.com/fsprojects/Paket/issues/487

#### 0.20.8 - 01.01.2015
* Disable NuGet v3 for now - seems to be unreliable.

Expand Down
17 changes: 8 additions & 9 deletions src/Paket.Core/NuGetV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,16 @@ let private loadFromCacheOrOData force fileName auth nugetURL package version =
let getDetailsFromNuget force auth nugetURL package (version:SemVerInfo) =
async {
try
let fi =
let packageUrl = sprintf "%s.%s.json" package (version.Normalize())
let cacheFile =
let h = nugetURL |> normalizeUrl |> hash |> abs
let packageUrl = sprintf "%s.%s.s%d.json" package (version.Normalize()) h
FileInfo(Path.Combine(CacheFolder,packageUrl))

let! (invalidCache,details) = loadFromCacheOrOData force fi.FullName auth nugetURL package version
if normalizeUrl details.SourceUrl <> normalizeUrl nugetURL then
return! getDetailsFromNuGetViaOData auth nugetURL package version
else
if invalidCache then
File.WriteAllText(fi.FullName,JsonConvert.SerializeObject(details))
return details
let! (invalidCache,details) = loadFromCacheOrOData force cacheFile.FullName auth nugetURL package version

if invalidCache then
File.WriteAllText(cacheFile.FullName,JsonConvert.SerializeObject(details))
return details
with
| _ -> return! getDetailsFromNuGetViaOData auth nugetURL package version
}
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<DocumentationFile>
</DocumentationFile>
<StartArguments>update -f</StartArguments>
<StartArguments>update</StartArguments>
<StartArguments>install</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>
</StartWorkingDirectory>
<StartWorkingDirectory>c:\code\suave</StartWorkingDirectory>
<StartWorkingDirectory>c:\code\PaketKopie</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit a1509e1

Please sign in to comment.