-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat : Implemented Virtual thread in backend
- Loading branch information
1 parent
6ae2c4e
commit 711f0b4
Showing
9 changed files
with
144 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 21 additions & 14 deletions
35
...ypath_backend/src/main/java/com/example/storypath_backend/config/CaffeineCacheConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
package com.example.storypath_backend.config; | ||
|
||
//@Configuration | ||
import com.github.benmanes.caffeine.cache.Caffeine; | ||
import org.springframework.cache.caffeine.CaffeineCacheManager; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
@Configuration | ||
public class CaffeineCacheConfig { | ||
// @Bean | ||
// public CaffeineCacheManager cacheManager() { | ||
// CaffeineCacheManager cacheManager = new CaffeineCacheManager("users", | ||
// "journals"); | ||
// cacheManager.setCaffeine(caffeineCacheBuilder()); | ||
// return cacheManager; | ||
// } | ||
// | ||
// Caffeine<Object, Object> caffeineCacheBuilder() { | ||
// return Caffeine.newBuilder() | ||
// .expireAfterAccess(60, TimeUnit.MINUTES) | ||
// .maximumSize(500); | ||
// } | ||
@Bean | ||
public CaffeineCacheManager cacheManager() { | ||
CaffeineCacheManager cacheManager = new CaffeineCacheManager("users", | ||
"journals"); | ||
cacheManager.setCaffeine(caffeineCacheBuilder()); | ||
return cacheManager; | ||
} | ||
|
||
Caffeine<Object, Object> caffeineCacheBuilder() { | ||
return Caffeine.newBuilder() | ||
.expireAfterAccess(60, TimeUnit.MINUTES) | ||
.maximumSize(500); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters