mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: AddMany to not open session if nothing to save (#61117)
This commit is contained in:
@@ -77,7 +77,9 @@ func (r *xormRepositoryImpl) Add(ctx context.Context, item *annotations.Item) er
|
||||
func (r *xormRepositoryImpl) AddMany(ctx context.Context, items []annotations.Item) error {
|
||||
hasTags := make([]annotations.Item, 0)
|
||||
hasNoTags := make([]annotations.Item, 0)
|
||||
|
||||
if len(items) == 0 {
|
||||
return nil
|
||||
}
|
||||
for i := range items {
|
||||
// The validation logic needs to work in terms of pointers.
|
||||
// So, force everything else to work in terms of pointers too, to avoid any implicit extra copying.
|
||||
|
||||
Reference in New Issue
Block a user