Skip to content

Commit

Permalink
Merge pull request #355 from newrelic/fix/logging-NR-338578
Browse files Browse the repository at this point in the history
Logging improvement with delay set to incompatible values
lovesh-ap authored Dec 12, 2024
2 parents a654667 + 4956365 commit 1320c15
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -218,6 +218,8 @@ private void readScanSchedule() throws RestrictionModeException {
} else {
throw new RestrictionModeException(INVALID_CRON_EXPRESSION_PROVIDED_FOR_IAST_RESTRICTED_MODE);
}
} else {
agentMode.getScanSchedule().setNextScanTime(new Date(Instant.now().toEpochMilli()));
}
agentMode.getScanSchedule().setDataCollectionTime(agentMode.getScanSchedule().getNextScanTime());
if(agentMode.getScanSchedule().isCollectSamples()){
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ public void startDataRequestSchedule(long delay, TimeUnit timeUnit){
} catch (Exception e) {
logger.log(LogLevel.WARNING, String.format("Error while reading Configuration security.scan_request_rate_limit : %s, Using default value %s replay request per min.", e.getMessage(), currentFetchThresholdPerMin), e, this.getClass().getName());
}
logger.log(LogLevel.INFO, String.format("IAST data pull request is scheduled at %s, after delay of %s seconds", AgentConfig.getInstance().getAgentMode().getScanSchedule().getDataCollectionTime(), initialDelay), IASTDataTransferRequestProcessor.class.getName());
logger.log(LogLevel.INFO, String.format("IAST data pull request is scheduled at %s", AgentConfig.getInstance().getAgentMode().getScanSchedule().getDataCollectionTime()), IASTDataTransferRequestProcessor.class.getName());
future = executorService.scheduleWithFixedDelay(this::task, initialDelay, delay, timeUnit);
} catch (Throwable ignored){}
}

0 comments on commit 1320c15

Please sign in to comment.