Try to Cache previously loaded Custom Node info#8
Open
saintentropy wants to merge 1 commit intomasterfrom
Open
Try to Cache previously loaded Custom Node info#8saintentropy wants to merge 1 commit intomasterfrom
saintentropy wants to merge 1 commit intomasterfrom
Conversation
| Exception ex; | ||
| try | ||
| { | ||
| var fileinfo = new FileInfo(path); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| Flush(); | ||
| } | ||
|
|
||
| public void Flush() |
There was a problem hiding this comment.
nitpick, but perhaps this will be clearer if you just call this method Serialize?
| cacheFilePath = filePath; | ||
| Load(); | ||
| // Not sure if this covers all cases. Can also add flush to Dispose | ||
| AppDomain.CurrentDomain.ProcessExit += (s, e) => FlushIfDirty(); |
There was a problem hiding this comment.
Do we need to unsubscribe this?
|
|
||
| public bool TryGet(string key, out T value) => cache.TryGetValue(key, out value); | ||
|
|
||
| public void Remove(string key) |
There was a problem hiding this comment.
I'm curious if the Remove function needs to be called at any time to clean up the cache dictionary. I think it may be needed when updating a custom node definition, i.e., a custom node with the same name as one that's already in the dictionary, but with a new time stamp that indicates that it has been edited.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
(FILL ME IN) This section describes why this PR is here. Usually it would include a reference to the tracking task that it is part or all of the solution for.
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
(FILL ME IN) Brief description of the fix / enhancement. Use N/A to indicate that the changes in this pull request do not apply to Release Notes. Mandatory section
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of