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

perf: set sync-timeout #3381

Merged
merged 1 commit into from
Apr 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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