This commit is contained in:
@@ -52,6 +52,8 @@ func (f *Feta) configure() {
|
||||
viper.AutomaticEnv()
|
||||
|
||||
viper.SetDefault("Debug", false)
|
||||
viper.SetDefault("TootsToDisk", false)
|
||||
viper.SetDefault("TootsToDB", true)
|
||||
viper.SetDefault("HostDiscoveryParallelism", 5)
|
||||
viper.SetDefault("FSStorageLocation", os.ExpandEnv("$HOME/Library/ApplicationSupport/feta/tootarchive.d"))
|
||||
viper.SetDefault("DBStorageLocation", os.ExpandEnv("$HOME/Library/ApplicationSupport/feta/feta.state.db"))
|
||||
@@ -138,8 +140,14 @@ func (f *Feta) runForever() int {
|
||||
panic("can't find home directory")
|
||||
}
|
||||
|
||||
diskBackend := storage.NewTootFSStorage(home + "/.local/feta")
|
||||
f.ingester.SetStorageBackend(diskBackend)
|
||||
if viper.GetBool("TootsToDB") {
|
||||
f.ingester.SetStorageBackend(f.dbm)
|
||||
} else if viper.GetBool("TootsToDisk") {
|
||||
diskBackend := storage.NewTootFSStorage(viper.GetString("FSStorageLocation"))
|
||||
f.ingester.SetStorageBackend(diskBackend)
|
||||
} else {
|
||||
log.Info().Msg("toots will not be saved to disk")
|
||||
}
|
||||
|
||||
f.api = new(Server)
|
||||
f.api.SetFeta(f) // api needs to get to us to access data
|
||||
|
||||
Reference in New Issue
Block a user