Skip to content

Commit

Permalink
Scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Jan 18, 2018
1 parent 43e5689 commit 41d5de6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dnscrypt-proxy/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ func ConfigLoad(proxy *Proxy, svcFlag *string, config_file string) error {
source.RefreshDelay = 24
}
source, sourceUrlsToPrefetch, err := NewSource(source.URL, source.MinisignKeyStr, source.CacheFile, source.FormatStr, time.Duration(source.RefreshDelay)*time.Hour)
proxy.urlsToPrefetch = append(proxy.urlsToPrefetch, sourceUrlsToPrefetch...)
if err != nil {
dlog.Criticalf("Unable use source [%s]: [%s]", sourceName, err)
continue
}
proxy.urlsToPrefetch = append(proxy.urlsToPrefetch, sourceUrlsToPrefetch...)
registeredServers, err := source.Parse()
if err != nil {
dlog.Criticalf("Unable use source [%s]: [%s]", sourceName, err)
Expand Down
3 changes: 2 additions & 1 deletion dnscrypt-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type App struct {

func main() {
dlog.Init("dnscrypt-proxy", dlog.SeverityNotice, "DAEMON")
dlog.Noticef("Starting dnscrypt-proxy %s", AppVersion)

cdLocal()

svcConfig := &service.Config{
Expand Down Expand Up @@ -99,7 +101,6 @@ func main() {
}

func (app *App) Start(service service.Service) error {
dlog.Noticef("Starting dnscrypt-proxy %s", AppVersion)
proxy := app.proxy
if err := InitPluginsGlobals(&proxy.pluginsGlobals, &proxy); err != nil {
dlog.Fatal(err)
Expand Down
2 changes: 2 additions & 0 deletions dnscrypt-proxy/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@ func NewSource(url string, minisignKeyStr string, cacheFile string, formatStr st
}
in, cached, fromBackup, delayTillNextUpdate, err := fetchWithCache(url, cacheFile, refreshDelay)
if err != nil {
dlog.Debugf("Scheduling [%s] for prefetch", url)
return source, urlsToPrefetch, err
}
sigCacheFile := cacheFile + ".minisig"
sigStr, sigCached, sigFromBackup, sigDelayTillNextUpdate, err := fetchWithCache(sigURL, sigCacheFile, refreshDelay)
if err != nil {
dlog.Debugf("Scheduling [%s] for prefetch", sigURL)
return source, urlsToPrefetch, err
}
signature, err := minisign.DecodeSignature(sigStr)
Expand Down

0 comments on commit 41d5de6

Please sign in to comment.