fjtirado commented on code in PR #3980:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3980#discussion_r2192994600
##########
api/kogito-services/src/main/java/org/kie/kogito/services/jobs/impl/InMemoryJobService.java:
##########
@@ -117,17 +103,14 @@ public String rescheduleJob(JobDescription
jobDescription) {
protected long calculateDelay(JobDescription description) {
long delay = Duration.between(ZonedDateTime.now(),
description.expirationTime().get()).toMillis();
- if (delay <= 0) {
- return 1;
- }
- return delay;
+ return delay <= 0 ? 1 : delay;
}
@Override
public void close() throws Exception {
LOGGER.info("closing in memory job service");
- scheduledJobs.clear();
scheduledJobs.forEach((k, v) -> v.cancel(true));
Review Comment:
Clear before forEach was an ominous bug
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]