[#6] Multiple cache files support #7
Labels
No labels
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/monza#7
Loading…
Reference in a new issue
No description provided.
Delete branch "nzinkevich/monza:cache_remove"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checks hashes of cached and remote blocks and recreates cache file if they are not equal
@ -59,0 +67,4 @@
if err != nil {
return nil, err
}
_ = os.Remove(dbPath)
How about having multiple caches?
The name of the cache will be the hash.
This way there is no need in additional check, just create a file and clean the cache with an explicit command.
Yeah, it's better to do this way. Rewrote logic without removing and hash comparison
71cc5dbb84
tof33aa47969
[#6] Invalid cache removingto [#6] Multiple cache files suppport@ -51,0 +51,4 @@
return nil, fmt.Errorf("error get validation block: %w", err)
}
if validationBlock == nil {
return nil, fmt.Errorf("validation block does not exist: %w", err)
This branch seems impossible to reach, because we check for the error above.
@ -51,0 +54,4 @@
return nil, fmt.Errorf("validation block does not exist: %w", err)
}
dbPath := path.Join(dir, validationBlock.Hash().String()+".db")
It is better to use
StringLE()
methods explicitly, because in neo-go LE is the method of presentation and it won't change from one version to another.f33aa47969
toce6489146f
[#6] Multiple cache files suppportto [#6] Multiple cache files support