Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 33e295e

Browse files
authored
SORMAS-Foundation#3523 remove caching for symptom journal token (SORMAS-Foundation#3565)
1 parent 01b85c2 commit 33e295e

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

sormas-backend/src/main/java/de/symeda/sormas/backend/externaljournal/ExternalJournalService.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
@LocalBean
6262
public class ExternalJournalService {
6363

64-
private static final String SYMPTOM_JOURNAL_KEY = "symptomJournal";
6564
private static final String PATIENT_DIARY_KEY = "patientDiary";
6665
private static final Cache<String, String> authTokenCache = CacheBuilder.newBuilder().expireAfterWrite(6, TimeUnit.HOURS).build();
6766
private static final int NOT_FOUND_STATUS = 404;
@@ -76,17 +75,13 @@ public class ExternalJournalService {
7675
private PersonFacadeEjb.PersonFacadeEjbLocal personFacade;
7776

7877
/**
79-
* Retrieves a token used for authenticating in the symptom journal. The token will be cached.
80-
*
78+
* Retrieves a token used for authenticating in the symptom journal.
79+
* The token will not be cached since it's only used once when opening the symptom journal
80+
*
8181
* @return the authentication token
8282
*/
8383
public String getSymptomJournalAuthToken() {
84-
try {
85-
return authTokenCache.get(SYMPTOM_JOURNAL_KEY, this::getSymptomJournalAuthTokenInternal);
86-
} catch (ExecutionException e) {
87-
logger.error(e.getMessage());
88-
return null;
89-
}
84+
return getSymptomJournalAuthTokenInternal();
9085
}
9186

9287
private String getSymptomJournalAuthTokenInternal() {

0 commit comments

Comments
 (0)