From 6b509b3997c8de0181787224090af98768e3e735 Mon Sep 17 00:00:00 2001 From: horus Date: Mon, 19 Feb 2018 21:22:30 +0100 Subject: Adds repair function. (crawler) --- crawler/config.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'crawler/config.go') diff --git a/crawler/config.go b/crawler/config.go index c9b17a4..f74253e 100644 --- a/crawler/config.go +++ b/crawler/config.go @@ -5,19 +5,21 @@ import ( ) type Config struct { - DBDriver string - DBDBName string - DBHost string - DBPort string - DBUser string - DBPassword string - DBOptions string - DBPath string // for sqlite + DBDriver string + DBDBName string + DBHost string + DBPort string + DBUser string + DBPassword string + DBOptions string + DBPath string // for sqlite + DisableURLShorter bool Polr_URL string Polr_API_Key string - Debug bool + Debug bool + FixDatabase bool } // Parses the configuration and sets the configuration struct. @@ -31,6 +33,7 @@ func (c *Config) parseConfig(configFile string) { viper.SetDefault("DB_Path", "./alkobote.db") viper.SetDefault("Debug", false) + viper.SetDefault("FixDatabase", false) viper.SetDefault("DisableURLShorter", false) // Name of the configuration file @@ -72,6 +75,7 @@ func (c *Config) setsConfig() { c.DBOptions = viper.GetString("DB_Options") c.DBPath = viper.GetString("DB_Path") c.Debug = viper.GetBool("Debug") + c.FixDatabase = viper.GetBool("FixDatabase") c.DisableURLShorter = viper.GetBool("DisableURLShorter") c.Polr_URL = viper.GetString("Polr_URL") c.Polr_API_Key = viper.GetString("Polr_API_Key") -- cgit v1.2.3