Skip to content

Only overwrite NuGet metadata cache when needed, cleanup and exception handling - #2998

Merged
forki merged 1 commit into
fsprojects:masterfrom
viktor-svub:feature/overwrite
Jan 18, 2018
Merged

forki merged 1 commit into
fsprojects:masterfrom
viktor-svub:feature/overwrite

Conversation

@viktor-svub

Copy link
Copy Markdown
Contributor

Cleaned up NuGet metadata cache access based on production experience:

1/ with explicit "force", do not re/query and overwrite the metadata cache twice

2/ stale cache file cleanup should not be performed on every single read -- doing this only on "force" seems like a good idea, there is "paket clear-cache" in case more "forceful" solution is needed

3/ do not overwrite cached metadata on each access with "force", if the content already equals -- the read and comparison is faster and does not cause file-access violations

let! result = get()
match result with
| ODataSearchResult.Match result ->
File.WriteAllText(cacheFile.FullName,JsonConvert.SerializeObject(result))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this line now needs to go

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove it myself.

@forki

forki commented Jan 18, 2018

Copy link
Copy Markdown
Member

Awesome. Keep them coming ;-)

@forki
forki merged commit 61186c3 into fsprojects:master Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants