Skip to content

Commit

Permalink
Do not create token usage stats when db is read only
Browse files Browse the repository at this point in the history
  • Loading branch information
zhx828 committed Nov 25, 2023
1 parent 7a2486d commit 8bc7cb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/mskcc/cbio/oncokb/web/rest/ApiProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ private int getUsageCount(String body, HttpMethod method) {

@Async
public void updateTokenStats(HttpServletRequest request, int usageCount) {
if (applicationProperties.getDbReadOnly()) {
return;
}
Optional<String> userOptional = SecurityUtils.getCurrentUserLogin();
if (userOptional.isPresent()) {
List<String> tokenUsageCheckWhitelist = Arrays.stream(applicationProperties.getTokenUsageCheckWhitelist().split(",")).map(api -> api.trim()).filter(api -> !api.isEmpty()).collect(Collectors.toList());
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/app/components/userMessager/UserMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ if (
<div>
<b>Attention</b>: We want to inform you of an upcoming infrastructure
update that may lead to a temporary service disruption, planned{' '}
<b>Nov 25th, 8am-12pm EDT</b>.
<b>Nov 25th to 26th</b>.
<br />
During this period, you may experience intermittent service
interruptions, brief outages, or slower response times while accessing
Expand All @@ -143,7 +143,7 @@ if (
),
backgroundColor: COLOR_WARNING,
color: COLOR_BLACK,
id: 'warning_msg_11192023',
id: 'warning_msg_11252023',
},
];
}
Expand Down

0 comments on commit 8bc7cb4

Please sign in to comment.