This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added scheduled call to app token dataservice
- Loading branch information
lmeinen
committed
Jun 25, 2021
1 parent
5f02ae8
commit 7888c9d
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...ain/java/ch/admin/bag/covidcertificate/backend/verifier/ws/config/WSSchedulingConfig.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package ch.admin.bag.covidcertificate.backend.verifier.ws.config; | ||
|
||
import ch.admin.bag.covidcertificate.backend.verifier.data.AppTokenDataService; | ||
import ch.admin.bag.covidcertificate.backend.verifier.model.AppToken; | ||
import ch.admin.bag.covidcertificate.backend.verifier.ws.config.model.ApiKeyConfig; | ||
import java.util.List; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
|
||
@Configuration | ||
@EnableScheduling | ||
public class WSSchedulingConfig { | ||
|
||
private final ApiKeyConfig apiKeyConfig; | ||
private final AppTokenDataService appTokenDataService; | ||
|
||
public WSSchedulingConfig( | ||
ApiKeyConfig apiKeyConfig, | ||
AppTokenDataService appTokenDataService) { | ||
this.apiKeyConfig = apiKeyConfig; | ||
this.appTokenDataService = appTokenDataService; | ||
} | ||
|
||
@Scheduled(cron = "${ws.authentication.cron:0 0/5 0 ? * *}") | ||
public void updateAppTokens() { | ||
final var appTokens = appTokenDataService.getAppTokens(); | ||
} | ||
} |
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