From beac8dc53c1d24293d169097217403c6bc4bbb2f Mon Sep 17 00:00:00 2001 From: horus Date: Sun, 19 Apr 2020 01:19:50 +0200 Subject: Tracing mysterious bug. --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 1548776..5a360df 100644 --- a/main.go +++ b/main.go @@ -191,7 +191,7 @@ func getStory(id int) (Story, bool) { log.Errorf("Failed to parse and match regex: %s\n", err.Error()) return Story, false } - is_wiki, err := regexp.MatchString("wikipedia.org($|/)", u.Host) + is_wiki, err := regexp.MatchString("(wikipedia.org)($|/)", u.Host) if err != nil { log.Errorf("Failed to parse and match regex: %s\n", err.Error()) return Story, false @@ -307,7 +307,11 @@ func (app *App) updateAllDiscussions() { if 0 == Story.Id { log.Warnf("updateAllDiscussions: Failure getting Story for item_id: %d\n", item_id) } else if Story.Descendants > 10 || Story.Score > 10 { - log.Warnf("%+v\n", Story) + log.Warnf(` + updateAllDiscussions: There is a bug. Can't update discussion with id %d. + NOTE: Is this is happening again, probably the url was changed from wikipedia to a different source. + %+v\n + `, item_id, Story) } return } -- cgit v1.2.3