@@ -111,27 +111,6 @@ type TypedFuncs[object any, request comparable] struct {
111
111
// Create implements EventHandler.
112
112
func (h TypedFuncs [object , request ]) Create (ctx context.Context , e event.TypedCreateEvent [object ], q workqueue.TypedRateLimitingInterface [request ]) {
113
113
if h .CreateFunc != nil {
114
- h .CreateFunc = func (ctx context.Context , e event.TypedCreateEvent [object ], trli workqueue.TypedRateLimitingInterface [request ]) {
115
- h .Create (ctx , e , workqueueWithCustomAddFunc [request ]{
116
- TypedRateLimitingInterface : trli ,
117
- addFunc : func (item request , q workqueue.TypedRateLimitingInterface [request ]) {
118
- priorityQueue , isPriorityQueue := q .(priorityqueue.PriorityQueue [request ])
119
- if ! isPriorityQueue {
120
- q .Add (item )
121
- return
122
- }
123
- var priority int
124
- obj , ok := any (e ).(event.TypedCreateEvent [client.Object ])
125
- if ! ok {
126
- return
127
- }
128
- if isObjectUnchanged (obj ) {
129
- priority = LowPriority
130
- }
131
- priorityQueue .AddWithOpts (priorityqueue.AddOpts {Priority : priority }, item )
132
- },
133
- })
134
- }
135
114
h .CreateFunc (ctx , e , q )
136
115
}
137
116
}
@@ -146,27 +125,6 @@ func (h TypedFuncs[object, request]) Delete(ctx context.Context, e event.TypedDe
146
125
// Update implements EventHandler.
147
126
func (h TypedFuncs [object , request ]) Update (ctx context.Context , e event.TypedUpdateEvent [object ], q workqueue.TypedRateLimitingInterface [request ]) {
148
127
if h .UpdateFunc != nil {
149
- h .UpdateFunc = func (ctx context.Context , tue event.TypedUpdateEvent [object ], trli workqueue.TypedRateLimitingInterface [request ]) {
150
- h .Update (ctx , e , workqueueWithCustomAddFunc [request ]{
151
- TypedRateLimitingInterface : trli ,
152
- addFunc : func (item request , q workqueue.TypedRateLimitingInterface [request ]) {
153
- priorityQueue , isPriorityQueue := q .(priorityqueue.PriorityQueue [request ])
154
- if ! isPriorityQueue {
155
- q .Add (item )
156
- return
157
- }
158
- var priority int
159
- obj , ok := any (tue ).(event.TypedUpdateEvent [client.Object ])
160
- if ! ok {
161
- return
162
- }
163
- if obj .ObjectOld .GetResourceVersion () == obj .ObjectNew .GetResourceVersion () {
164
- priority = LowPriority
165
- }
166
- priorityQueue .AddWithOpts (priorityqueue.AddOpts {Priority : priority }, item )
167
- },
168
- })
169
- }
170
128
h .UpdateFunc (ctx , e , q )
171
129
}
172
130
}
0 commit comments