This commit is contained in:
parent
8a2dbfec7a
commit
d4b51a6ad7
|
|
@ -69,6 +69,7 @@ type redisItem struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type fetch2 struct{}
|
type fetch2 struct{}
|
||||||
|
|
||||||
func (f *fetch2) Fetch(url string) (*http.Response, error) {
|
func (f *fetch2) Fetch(url string) (*http.Response, error) {
|
||||||
return Fetch2(url)
|
return Fetch2(url)
|
||||||
}
|
}
|
||||||
|
|
@ -645,6 +646,7 @@ func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel strin
|
||||||
// check for all channels as channel
|
// check for all channels as channel
|
||||||
// if regex matches item
|
// if regex matches item
|
||||||
// - add item to channel
|
// - add item to channel
|
||||||
|
|
||||||
for channelKey, setting := range b.Settings {
|
for channelKey, setting := range b.Settings {
|
||||||
if setting.IncludeRegex != "" {
|
if setting.IncludeRegex != "" {
|
||||||
included := false
|
included := false
|
||||||
|
|
@ -652,18 +654,14 @@ func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel strin
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error in regexp: %q\n", includeRegex)
|
log.Printf("error in regexp: %q\n", includeRegex)
|
||||||
} else {
|
} else {
|
||||||
if item.Content != nil && includeRegex.MatchString(item.Content.Text) {
|
if item.Content != nil {
|
||||||
log.Printf("Included %#v\n", item)
|
included = includeRegex.MatchString(item.Content.Text) || includeRegex.MatchString(item.Content.HTML)
|
||||||
included = true
|
|
||||||
}
|
|
||||||
|
|
||||||
if includeRegex.MatchString(item.Name) {
|
|
||||||
log.Printf("Included %#v\n", item)
|
|
||||||
included = true
|
|
||||||
}
|
}
|
||||||
|
included = included || includeRegex.MatchString(item.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if included {
|
if included {
|
||||||
|
log.Printf("Included %#v\n", item)
|
||||||
b.channelAddItem(conn, channelKey, item)
|
b.channelAddItem(conn, channelKey, item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -685,7 +683,6 @@ func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel strin
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if excludeRegex.MatchString(item.Name) {
|
if excludeRegex.MatchString(item.Name) {
|
||||||
log.Printf("Excluded %#v\n", item)
|
log.Printf("Excluded %#v\n", item)
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user