Reconcile NoExecute Taint

This commit is contained in:
kaiyuechen
2020-03-11 23:34:53 +08:00
parent cb38560422
commit b3637c9670
3 changed files with 40 additions and 3 deletions

View File

@@ -194,6 +194,15 @@ func (q *UniqueQueue) Clear() {
}
}
// SetRemove remove value from the set if value existed
func (q *UniqueQueue) SetRemove(value string) {
q.lock.Lock()
defer q.lock.Unlock()
if q.set.Has(value) {
q.set.Delete(value)
}
}
// RateLimitedTimedQueue is a unique item priority queue ordered by
// the expected next time of execution. It is also rate limited.
type RateLimitedTimedQueue struct {
@@ -280,6 +289,11 @@ func (q *RateLimitedTimedQueue) Clear() {
q.queue.Clear()
}
// SetRemove remove value from the set of the queue
func (q *RateLimitedTimedQueue) SetRemove(value string) {
q.queue.SetRemove(value)
}
// SwapLimiter safely swaps current limiter for this queue with the
// passed one if capacities or qps's differ.
func (q *RateLimitedTimedQueue) SwapLimiter(newQPS float32) {