64
64
)
65
65
@ Profile ("!unitTests" )
66
66
public class OrcidRedisHttpSessionConfiguration extends SpringHttpSessionConfiguration implements BeanClassLoaderAware , EmbeddedValueResolverAware , ImportAware {
67
-
68
- static final String DEFAULT_CLEANUP_CRON = "0 * * * * *" ;
69
67
private Integer maxInactiveIntervalInSeconds = 1800 ;
70
68
private String redisNamespace = "spring:session" ;
71
69
private FlushMode flushMode ;
@@ -82,10 +80,10 @@ public class OrcidRedisHttpSessionConfiguration extends SpringHttpSessionConfigu
82
80
private ClassLoader classLoader ;
83
81
private StringValueResolver embeddedValueResolver ;
84
82
85
- public OrcidRedisHttpSessionConfiguration () {
83
+ public OrcidRedisHttpSessionConfiguration (@ Value ( "${org.orcid.core.utils.cache.session.redis.cleanup.cron:5 */5 * * * *}" ) String cleanupCron ) {
86
84
this .flushMode = FlushMode .ON_SAVE ;
87
85
this .saveMode = SaveMode .ON_SET_ATTRIBUTE ;
88
- this .cleanupCron = "0 * * * * *" ;
86
+ this .cleanupCron = cleanupCron ;
89
87
this .configureRedisAction = new ConfigureNotifyKeyspaceEventsAction ();
90
88
}
91
89
@@ -163,10 +161,6 @@ public void setSaveMode(SaveMode saveMode) {
163
161
this .saveMode = saveMode ;
164
162
}
165
163
166
- public void setCleanupCron (String cleanupCron ) {
167
- this .cleanupCron = cleanupCron ;
168
- }
169
-
170
164
@ Autowired (
171
165
required = false
172
166
)
@@ -252,11 +246,6 @@ public void setImportMetadata(AnnotationMetadata importMetadata) {
252
246
253
247
this .flushMode = flushMode ;
254
248
this .saveMode = (SaveMode )attributes .getEnum ("saveMode" );
255
- String cleanupCron = attributes .getString ("cleanupCron" );
256
- if (StringUtils .hasText (cleanupCron )) {
257
- this .cleanupCron = cleanupCron ;
258
- }
259
-
260
249
}
261
250
262
251
private RedisTemplate <Object , Object > createRedisTemplate () {
0 commit comments