Skip to content

Commit

Permalink
invalidate repo cache on delete (argoproj#1182)
Browse files Browse the repository at this point in the history
Signed-off-by: Nestor <[email protected]>
  • Loading branch information
narg95 authored and alexmt committed Feb 26, 2019
1 parent 2f62d1b commit caacba9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ func (s *Server) Delete(ctx context.Context, q *RepoQuery) (*RepoResponse, error
if !s.enf.Enforce(ctx.Value("claims"), rbacpolicy.ResourceRepositories, rbacpolicy.ActionDelete, q.Repo) {
return nil, grpc.ErrPermissionDenied
}

// invalidate cache
if err := s.cache.SetRepoConnectionState(q.Repo, nil); err == nil {
log.Errorf("error invalidating cache: %v", err)
}

err := s.db.DeleteRepository(ctx, q.Repo)
return &RepoResponse{}, err
}

0 comments on commit caacba9

Please sign in to comment.