Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3381 from jumpeiMano/set-sync-timeout
Browse files Browse the repository at this point in the history
perf: set sync-timeout
  • Loading branch information
Kingdon Barrett authored Apr 23, 2021
2 parents 5777baa + b6026ff commit cf97726
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/daemon/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ type changeSet struct {

// Sync starts the synchronization of the cluster with git.
func (d *Daemon) Sync(ctx context.Context, started time.Time, newRevision string, rat ratchet) error {
ctx, cancel := context.WithTimeout(ctx, d.SyncTimeout)
defer cancel()

// Load last-synced resources for comparison
lastResources, err := d.getLastResources(ctx, rat)
if err != nil {
Expand Down

0 comments on commit cf97726

Please sign in to comment.