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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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{
|
||||
|
Reference in New Issue
Block a user