Skip to content

Commit

Permalink
Fixed typo and the properties to match the papi ones (#7127)
Browse files Browse the repository at this point in the history
  • Loading branch information
Camelia-Orcid authored Nov 6, 2024
1 parent 46e4985 commit 24bee07
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class PapiDailyLimitReport {
@Value("${org.orcid.core.orgs.load.slackUser}")
private String slackUser;

@Value("${rate.limit.anonymous.requests}")
@Value("${org.orcid.papi.rate.limit.anonymous.requests:10000}")
private int anonymousRequestLimit;

@Value("${rate.limit.known.requests}")
@Value("${org.orcid.papi.rate.limit.known.requests:40000}")
private int knownRequestLimit;

@Value("${rate.limit.enabled:false}")
@Value("${org.orcid.papi.rate.limit.enabled:false}")
private boolean enableRateLimiting;

@Autowired
Expand Down Expand Up @@ -72,12 +72,12 @@ public void papiDailyLimitReport() {
LocalDate yesterday = LocalDate.now().minusDays(1);
String mode = Features.ENABLE_PAPI_RATE_LIMITING.isActive() ? "ENFORCEMENT" : "MONITORING";
String SLACK_INTRO_MSG = "Public API Rate limit report - Date: " + yesterday.toString() + "\n Current Anonymous Requests Limit: " + anonymousRequestLimit
+ "\n Current Public API Clients Limit: " + knownRequestLimit + "\n Mode: " + mode;
+ "\nCurrent Public API Clients Limit: " + knownRequestLimit + "\n Mode: " + mode;
LOG .info(SLACK_INTRO_MSG);
slackManager.sendAlert(SLACK_INTRO_MSG, slackChannel, webhookUrl, webhookUrl);

String SLACK_STATS_MSG = "Count of Anonymous IPs blocked: " + papiRateLimitingDao.countAnonymousRequestsWithLimitExceeded(yesterday, anonymousRequestLimit)
+ "\n Count of Public API clients that have exceeded the limit: "
+ "\nCount of Public API clients that have exceeded the limit: "
+ papiRateLimitingDao.countClientRequestsWithLimitExceeded(yesterday, knownRequestLimit);
LOG .info(SLACK_STATS_MSG);
slackManager.sendAlert(SLACK_STATS_MSG, slackChannel, webhookUrl, webhookUrl);
Expand Down

0 comments on commit 24bee07

Please sign in to comment.