Compare commits
No commits in common. "41c079b87128215045b247883d796bfd3db00d50" and "6ed7dc8ddbe33d70824ae5f40bf58e92f0a849f8" have entirely different histories.
41c079b871
...
6ed7dc8ddb
|
|
@ -199,15 +199,12 @@ func (h *hubIncomingBackend) run() error {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
log.Println("Getting feeds for WebSub")
|
|
||||||
feeds := h.GetFeeds()
|
feeds := h.GetFeeds()
|
||||||
for _, feed := range feeds {
|
for _, feed := range feeds {
|
||||||
log.Printf("Looking at %s\n", feed.URL)
|
|
||||||
if feed.ResubscribeAt == 0 || time.Now().After(time.Unix(feed.ResubscribeAt, 0)) {
|
if feed.ResubscribeAt == 0 || time.Now().After(time.Unix(feed.ResubscribeAt, 0)) {
|
||||||
if feed.Callback == "" {
|
if feed.Callback == "" {
|
||||||
feed.Callback = fmt.Sprintf("%s/incoming/%d", os.Getenv("EKSTER_BASEURL"), feed.ID)
|
feed.Callback = fmt.Sprintf("%s/incoming/%d", os.Getenv("EKSTER_BASEURL"), feed.ID)
|
||||||
}
|
}
|
||||||
log.Printf("Send resubscribe for %s\n", feed.URL)
|
|
||||||
h.Subscribe(&feed)
|
h.Subscribe(&feed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -641,10 +641,6 @@ func (b *memoryBackend) Fetch3(channel, fetchURL string) (*http.Response, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel string, item microsub.Item) error {
|
func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel string, item microsub.Item) error {
|
||||||
// an item is posted
|
|
||||||
// check for all channels as channel
|
|
||||||
// if regex matches item
|
|
||||||
// - 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
|
||||||
|
|
@ -675,15 +671,9 @@ func (b *memoryBackend) channelAddItemWithMatcher(conn redis.Conn, channel strin
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("error in regexp: %q\n", excludeRegex)
|
log.Printf("error in regexp: %q\n", excludeRegex)
|
||||||
} else {
|
} else {
|
||||||
if item.Content != nil {
|
if item.Content != nil && excludeRegex.MatchString(item.Content.Text) {
|
||||||
if excludeRegex.MatchString(item.Content.Text) {
|
log.Printf("Excluded %#v\n", item)
|
||||||
log.Printf("Excluded %#v\n", item)
|
return nil
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if excludeRegex.MatchString(item.Content.HTML) {
|
|
||||||
log.Printf("Excluded %#v\n", item)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if excludeRegex.MatchString(item.Name) {
|
if excludeRegex.MatchString(item.Name) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user