Skip to content

Commit

Permalink
[#noissue] add max duration days
Browse files Browse the repository at this point in the history
  • Loading branch information
donghun-cho committed Jun 25, 2024
1 parent 9d42ca4 commit 00a8c7b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
@Validated
public class ApplicationController {
public static final int MAX_PAGING_LIMIT = 100;
public static final int MAX_DURATION_DAYS = 7;

private final AgentInfoService agentInfoService;

Expand All @@ -63,6 +64,7 @@ public ApplicationAgentHostList getApplicationHostInfo (
) {
int maxLimit = Math.min(MAX_PAGING_LIMIT, limit);
durationDays = ObjectUtils.defaultIfNull(durationDays, AgentInfoService.NO_DURATION);
durationDays = Math.min(MAX_DURATION_DAYS, durationDays);

Period durationDaysPeriod = Period.ofDays(durationDays);
return agentInfoService.getApplicationAgentHostList(offset, maxLimit, durationDaysPeriod);
Expand Down

0 comments on commit 00a8c7b

Please sign in to comment.