Skip to content

Commit a7df894

Browse files
committed
refactor: use Duration instead of TimeUnit for CacheControl
Relate to #1149
1 parent 7933118 commit a7df894

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/ru/mystamps/web/config/MvcConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
import ru.mystamps.web.support.spring.mvc.BigDecimalConverter;
6464
import ru.mystamps.web.support.spring.mvc.RestExceptionHandler;
6565

66+
import java.time.Duration;
6667
import java.util.Locale;
67-
import java.util.concurrent.TimeUnit;
6868

6969
@Configuration
7070
@EnableScheduling
@@ -114,7 +114,7 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
114114
.addFixedVersionStrategy(ResourceUrl.RESOURCES_VERSION, "/**");
115115

116116
@SuppressWarnings("checkstyle:magicnumber")
117-
CacheControl cacheControl = CacheControl.maxAge(7, TimeUnit.DAYS);
117+
CacheControl cacheControl = CacheControl.maxAge(Duration.ofDays(7));
118118

119119
registry.addResourceHandler("/static/**")
120120
.addResourceLocations("/WEB-INF/static/")

0 commit comments

Comments
 (0)