Skip to content

Remove autoupdate using polling method #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 8, 2016
Next Next commit
Use a POST request to trigger update.
The updater code has been moved to its own package.
The scheduler has been remove.
Some functions about unzipping files went into utilities.go
  • Loading branch information
matteosuppo committed Mar 1, 2016
commit d710b2df4a0b48aa4d0970ac8e2a48832b57e718
22 changes: 1 addition & 21 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"time"

log "github.com/Sirupsen/logrus"
"github.com/carlescere/scheduler"
"github.com/gin-gonic/gin"
"github.com/itsjamie/gin-cors"
"github.com/kardianos/osext"
Expand All @@ -25,7 +24,6 @@ import (
var (
version = "x.x.x-dev" //don't modify it, Jenkins will take care
git_revision = "xxxxxxxx" //don't modify it, Jenkins will take care
embedded_autoupdate = true
embedded_autoextract = false
hibernate = flag.Bool("hibernate", false, "start hibernated")
verbose = flag.Bool("v", true, "show debug logging")
Expand Down Expand Up @@ -141,25 +139,6 @@ func main() {
launchSelfLater()
}

if embedded_autoupdate {

var updater = &Updater{
CurrentVersion: version,
ApiURL: *updateUrl,
BinURL: *updateUrl,
DiffURL: "",
Dir: "update/",
CmdName: *appName,
}

if updater != nil {
updater_job := func() {
go updater.BackgroundRun()
}
scheduler.Every(5).Minutes().Run(updater_job)
}
}

log.Println("Version:" + version)

// hostname
Expand Down Expand Up @@ -244,6 +223,7 @@ func main() {
r.GET("/info", infoHandler)
r.POST("/killbrowser", killBrowserHandler)
r.POST("/pause", pauseHandler)
r.POST("/update", updateHandler)

go func() {
// check if certificates exist; if not, use plain http
Expand Down
Loading