This repository was archived by the owner on Dec 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 305
RecordPersister's 'Expiration' is not working #372
Copy link
Copy link
Open
Description
StoreBuilder.<BarCode, BufferedSource, List<ListDto>>parsedWithKey()
.fetcher(barCode -> responseConverter(
serverRestClient.getListsSingleForStore()))
.memoryPolicy(getMemoryPolicy())
.persister(getDataPersister(context))
.parser(GsonParserFactory.createSourceParser(gson, new TypeToken<List<ListDto>>() {
}.getType()))
.open();
private Persister getDataPersister(Context context) {
try {
return RecordPersister.create(getFileSystem(context), 1, TimeUnit.MINUTES);
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
private MemoryPolicy getMemoryPolicy() {
return MemoryPolicy
.builder()
.setExpireAfterWrite(1)
.setExpireAfterTimeUnit(TimeUnit.DAYS)
.build();
}
Data is fetched from the disk(not from network) even after the expiation time(here 1 minute).
Note : I am force killing the application and re-launching, so memory data is not used.
I even tried adding
networkBeforeStale()
But no change.
I read everything I could find online around this. So far no progress.
*Fresh data from network is fetched after i do this
Device Settings -> Applictions -> My Application -> Clear Cache
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels