mirror of
https://github.com/rancher/steve.git
synced 2025-09-12 21:39:30 +00:00
Change which object needs DeepCopy
This commit is contained in:
@@ -49,7 +49,7 @@ func debounceCounts(result chan types.APIEvent, input chan Count) {
|
|||||||
}
|
}
|
||||||
case <-t.C:
|
case <-t.C:
|
||||||
if currentCount != nil {
|
if currentCount != nil {
|
||||||
result <- toAPIEvent(*currentCount.DeepCopy())
|
result <- toAPIEvent(*currentCount)
|
||||||
currentCount = nil
|
currentCount = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -48,17 +48,6 @@ type Count struct {
|
|||||||
Counts map[string]ItemCount `json:"counts"`
|
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 {
|
type Summary struct {
|
||||||
Count int `json:"count,omitempty"`
|
Count int `json:"count,omitempty"`
|
||||||
States map[string]int `json:"states,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
|
counts[schema.ID] = itemCount
|
||||||
changedCount := map[string]ItemCount{
|
changedCount := map[string]ItemCount{
|
||||||
schema.ID: itemCount,
|
schema.ID: *itemCount.DeepCopy(),
|
||||||
}
|
}
|
||||||
|
|
||||||
result <- Count{
|
result <- Count{
|
||||||
|
Reference in New Issue
Block a user