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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ By making a contribution to this project, I certify that:
this project or the open source license(s) involved.
```


## Creating a release
Just create a new release on github, and our drone server will build and upload
the compiled binaries for every architecture in a zip file in the release itself.
2 changes: 1 addition & 1 deletion config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ v = true # show debug logging
appName = CreateBridge
updateUrl = http://downloads.arduino.cc/
#updateUrl = http://localhost/
origins = http://webide.arduino.cc:8080
origins = http://webide.arduino.cc:8080, https://scratch.mit.edu, http://scratchx.org
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 @@ -142,25 +140,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 @@ -245,6 +224,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