-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Renew image time to cleanup on comment Preview and Submit #992
Conversation
8d28f5e
to
fd1c47a
Compare
Pull Request Test Coverage Report for Build 853908858
💛 - Coveralls |
fd1c47a
to
627ec41
Compare
183758d
to
1bfdfab
Compare
1bfdfab
to
c950d70
Compare
I see what you did and this solution can probably work but there are a couple of things I don't like:
as I opened the ticket my idea was to isolate all of it on the image and service levels. i.e. some sort of event bus from rest to image communicating change event. I'm not sure if this even possible as I have not tried to write the actual code, just a feeling. Maybe moving this countdown store closer to the image will do it |
If the staging storage is part of the image.Store interface as it is now, we can't alter its commit and cleanup behaviour other than the way I did it above. The only way around is I can think of is implementing separate staging storage for images that will be independent of the normal one, then we'll have commit and cleanup and cleanup timer reset functionality in that separate package and not in three of them as of now. What do you think? |
bedc8f8
to
e40c68d
Compare
5f1dc2c
to
32286ad
Compare
2966571
to
4dd25aa
Compare
Codecov Report
@@ Coverage Diff @@
## master #992 +/- ##
==========================================
+ Coverage 43.99% 44.01% +0.01%
==========================================
Files 127 127
Lines 2905 2906 +1
Branches 656 657 +1
==========================================
+ Hits 1278 1279 +1
Misses 1614 1614
Partials 13 13
Continue to review full report at Codecov.
|
Also: - make commitTTL equal to EditDuration, so that image is committed to permanent storage after comment can no longer be edited - move cleanupTTL to Cleanup function, as it's not used elsewhere in the code - add variables to some tests sleeps, so that instead of being magic numbers they would rely on timers of structures they suppose to wait for
4dd25aa
to
3211079
Compare
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
That PR will delay the image clean up after it's loaded by preview, so the commenter would have more time to post it before cleanup removes it.
Also, reset the cleanup time on images in the submitted comment to prevent the situation when they are deleted from temporary storage before being move to the permanent one, waiting for comment EditDuration to expire. That resolves #909.