Skip to content
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

Merged

Conversation

TNohaic
Copy link
Contributor

@TNohaic TNohaic commented Mar 28, 2024

Add the possibility to wait between each request of an executeForEachEntryOf source

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;
Copy link
Member

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.");
Copy link
Member

@NassimBtk NassimBtk Mar 28, 2024

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;
Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (sleep != null) {

@NassimBtk NassimBtk merged commit ec61649 into main Mar 29, 2024
2 checks passed
@NassimBtk NassimBtk deleted the feature/issue-139-add-a-sleep-input-to-executeforeachentryof branch March 29, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a sleep input to executeForEachEntryOf
2 participants