mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
refactor(wildcard): optimize and add caching (#1634)
* fix(wildcard): avoid excessive allocations every loop * are you going to Scarborough Fair? * ruby ruby ruby ruby * ride on, little murphy * shirley? * to the moon * reggie are you there? * code 99 * my doctorate is in Art History * helps to be consistent * tidy * slow and steady gets the clam * oysters were better anyway * DIAL TONE
This commit is contained in:
parent
bc0f4cc055
commit
982f7ddf68
13 changed files with 177 additions and 60 deletions
|
@ -7,12 +7,12 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/autobrr/autobrr/pkg/errors"
|
||||
"github.com/autobrr/autobrr/pkg/regexcache"
|
||||
"github.com/autobrr/autobrr/pkg/sanitize"
|
||||
"github.com/autobrr/autobrr/pkg/wildcard"
|
||||
|
||||
|
@ -774,7 +774,7 @@ func matchRegex(tag string, filterList string) bool {
|
|||
if filter == "" {
|
||||
continue
|
||||
}
|
||||
re, err := regexp.Compile(`(?i)(?:` + filter + `)`)
|
||||
re, err := regexcache.Compile(`(?i)(?:` + filter + `)`)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue