-
1. Re: Scheduling of the cache cleaning.
nadirx Mar 30, 2016 12:06 PM (in response to n.dobryukha)We don't have a built-in scheduler, but you could use the following crontab:
0 9 * * * /path/to/server/bin/ispn-cli.sh -c --command='/host=master/server=server-one/subsystem=datagrid-infinispan/cache-container=clustered/distributed-cache=default:clear-cache()'
Make sure the crontab is for the same user who is running the server, so that "silent" connection is possible.
-
2. Re: Scheduling of the cache cleaning.
william.burns Mar 30, 2016 12:10 PM (in response to n.dobryukha)Not quite sure what you mean by cleaning. But if you mean checking for expired entries, you can configure it to run after a delay via configuration [1]. Note there is also an xml definition available for this.
Or if you really want it to occur at a given time, you can create a single thread scheduled executor manually [2] and then submit a task that does the following
cache.getAdvancedCache().getExpirationManager().processExpiration();
and schedule that to run at a fixed rate, such as every day.
[1] ExpirationConfigurationBuilder (Infinispan JavaDoc 8.1.2.Final API)