summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhorus2020-04-19 01:19:50 +0200
committerhorus2020-04-19 01:19:50 +0200
commitbeac8dc53c1d24293d169097217403c6bc4bbb2f (patch)
treefc7ba42987a179164b07d0180740ea96596621ed
parent6bf847341dd49a656065f38a48d378a4c8d5d387 (diff)
downloadcurious-crawler-beac8dc53c1d24293d169097217403c6bc4bbb2f.tar.gz
Tracing mysterious bug.
-rw-r--r--main.go8
1 files 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
}