add rss & crawl & webhook
This commit is contained in:
@@ -55,7 +55,7 @@ func (r *periodic) Run() (err error) {
|
||||
end := time.Date(today.Year(), today.Month(), today.Day(),
|
||||
config.end.Hour(), config.end.Minute(), 0, 0, today.Location())
|
||||
|
||||
buffer := 20 * time.Minute
|
||||
buffer := 30 * time.Minute
|
||||
endPlusBuffer := end.Add(buffer)
|
||||
if now.Before(end) || now.After(endPlusBuffer) {
|
||||
return
|
||||
|
||||
@@ -18,7 +18,6 @@ package rule
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
@@ -58,11 +57,8 @@ func (c *Config) Validate() error { //nolint:cyclop,gocognit
|
||||
if c.Name == "" {
|
||||
return errors.New("name is required")
|
||||
}
|
||||
if c.Query != "" && utf8.RuneCountInString(c.Query) < 5 {
|
||||
return errors.New("query must be at least 5 characters")
|
||||
}
|
||||
if c.Threshold == 0 {
|
||||
c.Threshold = 0.6
|
||||
c.Threshold = 0.5
|
||||
}
|
||||
if c.Threshold < 0 || c.Threshold > 1 {
|
||||
return errors.New("threshold must be between 0 and 1")
|
||||
|
||||
Reference in New Issue
Block a user