Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Clear FileSystemPersister #365

Open
Shakezulla57 opened this issue Sep 22, 2018 · 1 comment
Open

Clear FileSystemPersister #365

Shakezulla57 opened this issue Sep 22, 2018 · 1 comment

Comments

@Shakezulla57
Copy link

Shakezulla57 commented Sep 22, 2018

I'm currently using the FileSystemPersister setup like this:

FileSystemPersisterFactory.create( cache, pathResolver, 1, TimeUnit.HOURS )

I'd like to use getRefreshing() and clear(). However, FileSystemPersister doesn't implement Clearable. How can I bust the cache of the FileSystemPersister while still utilizing a timed cache and networkBeforeStale()?

The readme section about SourcePerster and FileSystem make it seem like this is supposed to be working. Am I missing something?

@digitalbuddha
Copy link
Contributor

You are correct, the FileSystemPersisterFactory is a convenience factory for common persisters. If you'd like a persister that implements Clearable you would have to implement that yourself. You can take a look at the persister that is generated by the factory as a starting point and then add the Clearable interface to it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
2 participants