working toward storing state in db

This commit is contained in:
2020-03-27 16:02:36 -07:00
parent 4f654a9423
commit 23c1b08798
14 changed files with 553 additions and 193 deletions

View File

@@ -1,16 +1,20 @@
package locator
import "encoding/json"
import "io/ioutil"
import "net/http"
import "time"
import "sync"
import (
"encoding/json"
"io/ioutil"
"net/http"
"sync"
"time"
import "github.com/rs/zerolog/log"
import "golang.org/x/sync/semaphore"
import "git.eeqj.de/sneak/feta/jsonapis"
import "git.eeqj.de/sneak/feta/instance"
import "git.eeqj.de/sneak/feta"
"git.eeqj.de/sneak/feta/instance"
"git.eeqj.de/sneak/feta/jsonapis"
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
"golang.org/x/sync/semaphore"
)
//import "git.eeqj.de/sneak/feta"
// IndexAPITimeout is the timeout for fetching json instance lists
// from the listing servers
@@ -120,8 +124,7 @@ func (il *InstanceLocator) Locate() {
time.Sleep(1 * time.Second)
c := feta.GetConfig()
if time.Now().After(x.Add(c.LogReportInterval)) {
if time.Now().After(x.Add(viper.GetDuration("LogReportInterval"))) {
x = time.Now()
log.Debug().
Str("nextMastodonIndexRefresh", il.durationUntilNextMastodonIndexRefresh().String()).