Fix sample app to init Store on Application creation #149
Conversation
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name=".activity.PersistingStoreActivity"> |
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.
Don't we need both activities in manifest?
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.
Oh sorry that was just label duh
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.
Yeah it's just a matter of what a user wants to test :)
.fetcher(barCode -> provideRetrofit().fetchSubreddit(barCode.getKey(), "10")) | ||
.memory(CacheBuilder.newBuilder() | ||
.maximumSize(1) | ||
.expireAfterWrite(10, TimeUnit.SECONDS) |
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.
@pavlospt
The setting has no effect. The cache won't get cleared after 10 secs.
Still can get data from memory after 10 secs.
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 know why, I'll fix it in am.
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.
@tsaisean it works fine for me. It didnt go through the fetcher during the 10 seconds period.
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.
@pavlospt What about after 10secs?
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.
@tsaisean just saw that one. Since @digitalbuddha said he knows what's wrong, I think we should wait till he replies and someone can get on with a fix!
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 need to double check but there's a few things working against this example. First there is a 1min denouncer in the network layer. Second there is a no op persister that is caching stuff in memory. Will have a fix today. Nothing should be affected for real cache policies (over 1 min)
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.
@digitalbuddha maybe we'll need to adjust the debouncer to the cache TTL ?
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.
Yes also the noop persister is currently backed by a hashmap, that also needs to be a guava cache with timeout same as memory cache and denouncer. So really denouncer and noop persister should have a max of the mem cache policy.
Fixing #147 & #148