Skip to content

Commit 8d1dcbb

Browse files
fix:[PIPE-22127] Forced pause to prevent duplicate webhook creation (#1111)
1 parent a3f68a8 commit 8d1dcbb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/service/pipeline/triggers/resource_triggers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package triggers
33
import (
44
"context"
55
"net/http"
6+
"time"
67

78
"github.com/antihax/optional"
89
"github.com/harness/harness-go-sdk/harness/nextgen"
@@ -89,6 +90,8 @@ func resourceTriggersCreateOrUpdate(ctx context.Context, d *schema.ResourceData,
8990
d.Get("target_id").(string), &nextgen.TriggersApiCreateTriggerOpts{
9091
WithServiceV2: optional.NewBool(true),
9192
})
93+
// A FORCED PAUSE TO PREVENT DUPLICATE WEBHOOK CREATION.
94+
time.Sleep(5 * time.Second)
9295
} else {
9396
resp, httpResp, err = c.TriggersApi.UpdateTrigger(ctx, d.Get("yaml").(string), c.AccountId, d.Get("org_id").(string),
9497
d.Get("project_id").(string),

0 commit comments

Comments
 (0)