func backgroundUpdate() {
	for {
		time.Sleep(githubRefreshTime)
		if err := updateAssets(); err != nil {
			log.Debugf("updateAssets: %s", err)
		}
	}
}
backgroundUpdate periodically looks for releases.
package main
import (
	"encoding/json"
	"flag"
	"net/http"
	"os"
	"time"
	"github.com/getlantern/autoupdate-server/server"
	"github.com/getlantern/golog"
)
var (
	flagPrivateKey         = flag.String("k", "", "Path to private key.")
	flagLocalAddr          = flag.String("l", ":6868", "Local bind address.")
	flagPublicAddr         = flag.String("p", "http://127.0.0.1:6868/", "Public address.")
	flagGithubOrganization = flag.String("o", "getlantern", "Github organization.")
	flagGithubProject      = flag.String("n", "lantern", "Github project name.")
	flagHelp               = flag.Bool("h", false, "Shows help.")
)
var (
	log            = golog.LoggerFor("autoupdate-server")
	releaseManager *server.ReleaseManager
)
type updateHandler struct {
}
func updateAssets() error {
	log.Debug("Updating assets...")
	if err := releaseManager.UpdateAssetsMap(); err != nil {
		return err
	}
	return nil
}