Skip to content

Commit d4d5fdb

Browse files
committed
updated timeout for git material save/update
1 parent 619006e commit d4d5fdb

File tree

6 files changed

+22
-13
lines changed

6 files changed

+22
-13
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8
2424
github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e
2525
github.com/devtron-labs/go-bitbucket v0.9.60-beta
26-
github.com/devtron-labs/protos v0.0.3-0.20250320112837-a8190ec7cd67
26+
github.com/devtron-labs/protos v0.0.3-0.20250323161859-1e84b4db2917
2727
github.com/evanphx/json-patch v5.9.0+incompatible
2828
github.com/gammazero/workerpool v1.1.3
2929
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,8 @@ github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250313102545-75df8a
798798
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250313102545-75df8a5bec13/go.mod h1:1QJJLpgJSkb5Jm9xPeKAk+kXb0QgBOOOgJj0cgYhAVA=
799799
github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU=
800800
github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y=
801-
github.com/devtron-labs/protos v0.0.3-0.20250320112837-a8190ec7cd67 h1:gH82ad3wOUH7oEac9NA5jIx/ZIzd77siI/pHI2WONmM=
802-
github.com/devtron-labs/protos v0.0.3-0.20250320112837-a8190ec7cd67/go.mod h1:1TqULGlTey+VNhAu/ag7NJuUvByJemkqodsc9L5PHJk=
801+
github.com/devtron-labs/protos v0.0.3-0.20250323161859-1e84b4db2917 h1:g4R93NXNrHRv2FiGTrqKR7qb5bx6sGXD0Qy7UoOP6pw=
802+
github.com/devtron-labs/protos v0.0.3-0.20250323161859-1e84b4db2917/go.mod h1:1TqULGlTey+VNhAu/ag7NJuUvByJemkqodsc9L5PHJk=
803803
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
804804
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
805805
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=

pkg/pipeline/CiCdPipelineOrchestrator.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,14 @@ func (impl CiCdPipelineOrchestratorImpl) updateRepositoryToGitSensor(material *r
14951495
CloningMode: cloningMode,
14961496
PreserveMode: preserveMode,
14971497
}
1498-
return impl.GitSensorClient.UpdateRepo(context.Background(), sensorMaterial)
1498+
timeout := 10 * time.Minute
1499+
if preserveMode {
1500+
// additional time may be required for dir snapshot
1501+
timeout = 15 * time.Minute
1502+
}
1503+
ctx, cancel := context.WithTimeout(context.Background(), timeout)
1504+
defer cancel()
1505+
return impl.GitSensorClient.UpdateRepo(ctx, sensorMaterial)
14991506
}
15001507

15011508
func (impl CiCdPipelineOrchestratorImpl) addRepositoryToGitSensor(materials []*bean.GitMaterial, cloningMode string) error {
@@ -1513,7 +1520,9 @@ func (impl CiCdPipelineOrchestratorImpl) addRepositoryToGitSensor(materials []*b
15131520
}
15141521
sensorMaterials = append(sensorMaterials, sensorMaterial)
15151522
}
1516-
return impl.GitSensorClient.AddRepo(context.Background(), sensorMaterials)
1523+
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
1524+
defer cancel()
1525+
return impl.GitSensorClient.AddRepo(ctx, sensorMaterials)
15171526
}
15181527

15191528
// FIXME: not thread safe

vendor/github.com/devtron-labs/protos/gitSensor/service.pb.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/devtron-labs/protos/gitSensor/service.proto

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ github.com/devtron-labs/common-lib/workflow
383383
# github.com/devtron-labs/go-bitbucket v0.9.60-beta
384384
## explicit; go 1.14
385385
github.com/devtron-labs/go-bitbucket
386-
# github.com/devtron-labs/protos v0.0.3-0.20250320112837-a8190ec7cd67
386+
# github.com/devtron-labs/protos v0.0.3-0.20250323161859-1e84b4db2917
387387
## explicit; go 1.17
388388
github.com/devtron-labs/protos/gitSensor
389389
# github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f

0 commit comments

Comments
 (0)