-
Notifications
You must be signed in to change notification settings - Fork 411
persister: Expose method to read ChannelMonitors from disk #863
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
persister: Expose method to read ChannelMonitors from disk #863
Conversation
Codecov Report
@@ Coverage Diff @@
## main #863 +/- ##
==========================================
+ Coverage 90.59% 92.49% +1.89%
==========================================
Files 51 51
Lines 27195 32604 +5409
==========================================
+ Hits 24638 30157 +5519
+ Misses 2557 2447 -110
Continue to review full report at Codecov.
|
{ | ||
let path = self.path_to_monitor_data(); | ||
if !Path::new(&path).exists() { | ||
return Ok(HashMap::new()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a NotFound
error? That way caller's can create the directory if it does not exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, isn't it more likely its just the first startup and thus there's no monitors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that the caller would handle creating the directory. But I guess that FilesystemPersister
creates it on demand, so probably ok then. Wasn't sure if we want to give the user insight into this (e.g., they instantiate a persister expecting to find data but don't because the path was wrong).
34e7c66
to
bcd1345
Compare
bcd1345
to
94aa47b
Compare
Tested w/ the sample.