-
Notifications
You must be signed in to change notification settings - Fork 240
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
if cache data exists, it needs to flush the data into the storage before shutdown #541
if cache data exists, it needs to flush the data into the storage before shutdown #541
Conversation
…ore shutdown. Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
#540 (comment) can be fixed with this PR. |
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
// if cache data exists, it must flush the data into the storage | ||
if (!cache_.empty()) { | ||
storage_->write(cache_); | ||
// reset cache |
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.
Since this code is used as is in multiple places now, can be put this inside a helper to avoid duplication? maybe a reset_cache
method?
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.
sounds good, will do that.
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.
Just one minor thing otherwise LGTM
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.
LGTM with the nit to de-duplicate the logic also on line 254.
Signed-off-by: Tomoya.Fujita <Tomoya.Fujita@sony.com>
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.
LGTM, I'll kick off CI and let's merge if green.
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.
LGTM :)
Thank you @fujitatomoya
close #540
Signed-off-by: Tomoya.Fujita Tomoya.Fujita@sony.com