Skip to content

fix version cache key in msbuild task #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2015
Merged

Conversation

SimonCropp
Copy link
Contributor

fixes #488

var ticks = DirectoryDateFinder.GetLastDirectoryWrite(directory);
var key = string.Format("{0}:{1}:{2}", repo.Head.CanonicalName, repo.Head.Tip.Sha, ticks);
var ticks = DirectoryDateFinder.GetLastDirectoryWrite(gitDir);
var key = string.Format("{0}:{1}:{2}",gitDir, repo.Head.CanonicalName, repo.Head.Tip.Sha);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ticks is no longer used?

Copy link
Contributor

Choose a reason for hiding this comment

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

var key = string.Format("{0}:{1}:{2}:{3}",gitDir, repo.Head.CanonicalName, repo.Head.Tip.Sha, ticks); ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we dont want ticks in the key. they are used in the second step. a static dictionary is bascially a memory leak. keying on ticks is not great since we gradually add more to the dictionary on every change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, if tip sha has changed, recalc. Got it

Copy link
Member

Choose a reason for hiding this comment

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

The dictionary should probably be changed to a ConcurrentDictionary too, to avoid race conditions and concurrency issues if (and with Roslyn; when) the build is parallelized.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@asbjornu agreed. make it so

JakeGinnivan added a commit that referenced this pull request Aug 20, 2015
fix version cache key in msbuild task
@JakeGinnivan JakeGinnivan merged commit e7a30cc into master Aug 20, 2015
@JakeGinnivan JakeGinnivan deleted the taskVersionCache branch August 20, 2015 07:57
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.

Version number is not cached between projects in a solution
3 participants