You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2022/02/25 12:25:27 UTC

[skywalking-infra-e2e] branch main updated: Make `times` parameter doc more clear. (#71)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git


The following commit(s) were added to refs/heads/main by this push:
     new ccb8dd7  Make `times` parameter doc more clear. (#71)
ccb8dd7 is described below

commit ccb8dd74a8f75d5ee3e59992c219f36aaf0c3944
Author: ethan256 <46...@users.noreply.github.com>
AuthorDate: Fri Feb 25 20:25:22 2022 +0800

    Make `times` parameter doc more clear. (#71)
---
 docs/en/concepts-and-designs/module-design.md | 2 +-
 internal/components/trigger/http.go           | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/en/concepts-and-designs/module-design.md b/docs/en/concepts-and-designs/module-design.md
index 494b513..06bb400 100644
--- a/docs/en/concepts-and-designs/module-design.md
+++ b/docs/en/concepts-and-designs/module-design.md
@@ -66,7 +66,7 @@ Generate traffic by trigger the action, It could access `HTTP API` or execute `c
 
 It could have these settings:
 1. **interval**: How frequency to trigger the action.
-1. **times**: How many times to trigger the action, `0=infinite`.
+1. **times**: How many times the operation is triggered before aborting on the condition that the trigger had failed always. `0=infinite`.
 1. **action**: The action of the trigger.
 
 ### Verify
diff --git a/internal/components/trigger/http.go b/internal/components/trigger/http.go
index a97d92a..3d62062 100644
--- a/internal/components/trigger/http.go
+++ b/internal/components/trigger/http.go
@@ -79,7 +79,8 @@ func (h *httpAction) Do() chan error {
 			case <-t.C:
 				err := h.execute()
 
-				// `h.times == h.executedCount` makes sure to only send the first error
+				// `err == nil`: if no error occurs, everything is OK and send `nil` to the channel to continue.
+				// `h.times == h.executedCount`: reach to the maximum retry count and send the `err`, no matter it's `nil` or not.
 				if !sent && (err == nil || h.times == h.executedCount) {
 					result <- err
 					sent = true