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

Clearable #367

Open
victor-radulescu opened this issue Oct 17, 2018 · 2 comments
Open

Clearable #367

victor-radulescu opened this issue Oct 17, 2018 · 2 comments

Comments

@victor-radulescu
Copy link

I don't understand how to implement a Clearable
I have this class ClearAbleRecordPersister extends RecordPersister implements Clearable {
...
@OverRide
public void clear(@nonnull BarCode key) {
//TODO what show i do here?
}
My Store persister instance:
val cacheDir: File = MyApplication.getContext().cacheDir
return ClearAbleRecordPersister.create(cacheDir,30,TimeUnit.MINUTES)
}

Could not erase the data in any way. Can someone help me with it

@victor-radulescu
Copy link
Author

victor-radulescu commented Oct 17, 2018

tryed the folowing in onClear method

fileEraser.delete(key)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.io())
                .subscribe(new Observer<Boolean>() {
            @Override
            public void onSubscribe(Disposable d) {
                Log.d("clearing", "subscribe");
            }
           @Override
            public void onNext(Boolean aBoolean) {
                Log.d("clearing", "next " + aBoolean);
            }
            @Override
            public void onError(Throwable e) {
                Log.d("clearing", "error " + e.getMessage());
            }
          @Override
            public void onComplete() {
                Log.d("clearing", "complete");

            }
        });

I got this error: : error unable to delete /data/user/0/packagename/cache/subscribtion/42961

@digitalbuddha
Copy link
Contributor

I think you need to handle the case where you are clearing something for a key/path that is not created yet.

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

No branches or pull requests

2 participants