Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the type assertion for event watcher cache #3758

Merged
merged 2 commits into from
Jun 21, 2022
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
4 changes: 2 additions & 2 deletions pkg/app/piped/eventwatcher/eventwatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (w *watcher) run(ctx context.Context, repo git.Repo, repoCfg config.PipedRe
}
// Return a last scanned application if there is no new commit pushed from last scanned time for this application.
if v, ok := w.lastScannedConfig.Load(app.Id); ok {
c := v.(eventWatcherCache)
c := v.(*eventWatcherCache)
if c.HeadCommit == headCommit.Hash {
ew := eventWatcherConfig{
GitPath: c.GitPath,
Expand Down Expand Up @@ -621,7 +621,7 @@ func (w *watcher) commitFiles(ctx context.Context, latestData, eventName, commit
if err := os.WriteFile(path, newContent, os.ModePerm); err != nil {
return fmt.Errorf("failed to write file: %w", err)
}
changes[r.File] = newContent
changes[filePath] = newContent
}
if len(changes) == 0 {
return nil
Expand Down