1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-12 13:31:57 +00:00

Change which object needs DeepCopy

This commit is contained in:
Jonathan Crowther
2024-03-13 19:41:21 -04:00
parent cec59c5a61
commit abbe805737
2 changed files with 2 additions and 13 deletions

View File

@@ -49,7 +49,7 @@ func debounceCounts(result chan types.APIEvent, input chan Count) {
}
case <-t.C:
if currentCount != nil {
result <- toAPIEvent(*currentCount.DeepCopy())
result <- toAPIEvent(*currentCount)
currentCount = nil
}
}

View File

@@ -48,17 +48,6 @@ type Count struct {
Counts map[string]ItemCount `json:"counts"`
}
func (c *Count) DeepCopy() *Count {
r := *c
if r.Counts != nil {
r.Counts = map[string]ItemCount{}
for k, v := range c.Counts {
r.Counts[k] = *v.DeepCopy()
}
}
return &r
}
type Summary struct {
Count int `json:"count,omitempty"`
States map[string]int `json:"states,omitempty"`
@@ -192,7 +181,7 @@ func (s *Store) Watch(apiOp *types.APIRequest, schema *types.APISchema, w types.
counts[schema.ID] = itemCount
changedCount := map[string]ItemCount{
schema.ID: itemCount,
schema.ID: *itemCount.DeepCopy(),
}
result <- Count{