-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #139: Add a sleep input to executeForEachEntryOf #141
Issue #139: Add a sleep input to executeForEachEntryOf #141
Conversation
Add the possibility to wait between each request of an executeForEachEntryOf source
) { | ||
this.source = source; | ||
this.concatMethod = concatMethod == null ? EntryConcatMethod.LIST : concatMethod; | ||
this.sleep = sleep == null ? 0 : sleep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to this.sleep = sleep;
try { | ||
Thread.sleep(sleep); | ||
} catch (InterruptedException e) { | ||
log.error("threadSleep", "Thread interrupted during sleep between two requests."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log.error("Hostname {} - Thread interrupted during sleep between two 'execute for each entry' requests.", hostname);
* The sleep integer in ms. | ||
*/ | ||
@JsonSetter(nulls = SKIP) | ||
private Integer sleep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deserialize with PositiveIntegerDeserializer
@@ -505,6 +507,14 @@ private SourceTable processExecuteForEachEntryOf(final Source source, final Stri | |||
copy.update(value -> replaceSourceReference(value, copy)); | |||
|
|||
concatEntryResult(source, result, row, copy.accept(sourceProcessor)); | |||
if (sleep != null && sleep > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (sleep != null) {
…-a-sleep-input-to-executeforeachentryof
Correction after PR review
Add the possibility to wait between each request of an executeForEachEntryOf source