| Total Complexity | 1 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package com.osomapps.pt.config; |
||
| 14 | @Configuration |
||
| 15 | @EnableCaching |
||
| 16 | @EnableJdbcHttpSession(tableName = "ptcore.SPRING_SESSION") |
||
| 17 | class CachingConfig { |
||
| 18 | |||
| 19 | @Bean |
||
| 20 | CacheManager cacheManager() { |
||
| 21 | final SimpleCacheManager cacheManager = new SimpleCacheManager(); |
||
| 22 | cacheManager.setCaches( |
||
| 23 | Arrays.asList( |
||
| 24 | new ConcurrentMapCache( |
||
| 25 | "dictionaryData", |
||
| 26 | CacheBuilder.newBuilder() |
||
| 27 | .expireAfterWrite(1, TimeUnit.DAYS) |
||
| 28 | .build() |
||
| 29 | .asMap(), |
||
| 30 | false), |
||
| 31 | new ConcurrentMapCache( |
||
| 32 | "dictionaryAllData", |
||
| 33 | CacheBuilder.newBuilder() |
||
| 34 | .expireAfterWrite(1, TimeUnit.DAYS) |
||
| 35 | .build() |
||
| 36 | .asMap(), |
||
| 37 | false))); |
||
| 38 | return cacheManager; |
||
| 39 | } |
||
| 41 |