Skip to content
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

How to set an expiration time? #43

Open
godfatherzzx opened this issue Jun 27, 2018 · 4 comments
Open

How to set an expiration time? #43

godfatherzzx opened this issue Jun 27, 2018 · 4 comments

Comments

@godfatherzzx
Copy link

for some reason, I need to set an expiration time for the snapshot. so how to configure the plugin?
Thanks for you work.

@ssong-van
Copy link
Contributor

Do you mean the timestamp field in SnapshotMetadata when saving a snapshot? I think it's only used optionally when searching for a snapshot. It defaults to 0L and this plugin should store the value as is.

@godfatherzzx
Copy link
Author

No. For there is not enough redis space for the snapshot, so it is prudent to create a process to clean up some data after a period of time. Thanks for your reply.

@ssong-van
Copy link
Contributor

Just so I understand correctly, are you suggesting to add ability in this plugin to specify a timeout (Redis TTL) on a snapshot? Snapshots are stored in a Sorted Set with persistenceId as key. Redis can only expire the entire Set, meaning all snapshots under the same persistenceId will be lost. An alternative solution could be to have an actor that cleans up snapshot by calling deleteAsync with a timestamp.

@godfatherzzx
Copy link
Author

I tried the function: deleteSnapshots(criteria: SnapshotSelectionCriteria), and it didn't work.

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

No branches or pull requests

2 participants