summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authoradmin2024-09-23 15:33:44 +0200
committeradmin2024-09-23 15:33:44 +0200
commit0b8d19eeae79030458b3e1492dd6b0c5a5bf2d75 (patch)
treebaa63f7d8c862c696affe5913553493c1f3e61c1 /config.go
parentb190512e951efdd1ed4642eed8726bf7bdf2c022 (diff)
downloadhncrawler-0b8d19eeae79030458b3e1492dd6b0c5a5bf2d75.tar.gz
saves last seen max_story_id and stops walk down there
Diffstat (limited to 'config.go')
-rw-r--r--config.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.go b/config.go
index 7c36c53..0da0dde 100644
--- a/config.go
+++ b/config.go
@@ -24,6 +24,7 @@ type Config struct {
BasicAuthPassword string
Debug bool // sets log level to debug
+ OnlyUpdateStories bool
}
// Parses the configuration and sets the configuration struct.
@@ -35,6 +36,7 @@ func (c *Config) parseConfig(configFile string) {
viper.SetDefault("DB_Port", "3306")
viper.SetDefault("Debug", false)
+ viper.SetDefault("OnlyUpdateStories", false)
viper.SetDefault("Delay", 0)
// needs some refactoring to truly respect robots.txt
@@ -101,4 +103,5 @@ func (c *Config) setsConfig() {
c.BasicAuthPassword = viper.GetString("BasicAuthPassword")
c.Debug = viper.GetBool("Debug")
+ c.OnlyUpdateStories = viper.GetBool("OnlyUpdateStories")
}