Skip to content

Commit

Permalink
Merge pull request #22 from horockey/dev
Browse files Browse the repository at this point in the history
fix: canonical keys and tags
  • Loading branch information
horockey authored Dec 10, 2023
2 parents 70ab1c5 + df2ea58 commit 13c52b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"sort"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -147,6 +148,8 @@ func (s *Scheduler[T]) UnscheduleByTag(tag string) error {
s.mu.Lock()
defer s.mu.Unlock()

tag = strings.ToUpper(tag)

idxToRemove := []int{}
for idx, node := range s.nodes {
if !slices.Contains(node.Event.Tags(), tag) {
Expand All @@ -171,6 +174,8 @@ func (s *Scheduler[T]) UnscheduleByHeader(key, value string) error {
s.mu.Lock()
defer s.mu.Unlock()

key = strings.ToUpper(key)

idxToRemove := []int{}
for idx, node := range s.nodes {
if val, ok := node.Event.Headers()[key]; !ok || val != value {
Expand Down

0 comments on commit 13c52b1

Please sign in to comment.