server: automatically flush the repository after setting or deleting a policy
Fixes
@@ -63,6 +63,10 @@ func (s *Server) handlePolicyDelete(ctx context.Context, r *http.Request) (inter
return nil, internalServerError(err)
}
+ if err := s.rep.Flush(ctx); err != nil {
+ return nil, internalServerError(err)
+ }
+
return &serverapi.Empty{}, nil
}
@@ -76,5 +80,9 @@ func (s *Server) handlePolicyPut(ctx context.Context, r *http.Request) (interfac
return nil, internalServerError(err)
}
+ if err := s.rep.Flush(ctx); err != nil {
+ return nil, internalServerError(err)
+ }
+
return &serverapi.Empty{}, nil
}
