Skip to content

Commit 90677b6

Browse files
committed
Merge pull request #73 from arduino/updater
Use a POST request to trigger update.
2 parents 95f9053 + d47afcd commit 90677b6

File tree

11 files changed

+1159
-367
lines changed

11 files changed

+1159
-367
lines changed

main.go

+1-21
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"time"
1515

1616
log "github.com/Sirupsen/logrus"
17-
"github.com/carlescere/scheduler"
1817
"github.com/gin-gonic/gin"
1918
"github.com/itsjamie/gin-cors"
2019
"github.com/kardianos/osext"
@@ -25,7 +24,6 @@ import (
2524
var (
2625
version = "x.x.x-dev" //don't modify it, Jenkins will take care
2726
git_revision = "xxxxxxxx" //don't modify it, Jenkins will take care
28-
embedded_autoupdate = true
2927
embedded_autoextract = false
3028
hibernate = flag.Bool("hibernate", false, "start hibernated")
3129
verbose = flag.Bool("v", true, "show debug logging")
@@ -142,25 +140,6 @@ func main() {
142140
launchSelfLater()
143141
}
144142

145-
if embedded_autoupdate {
146-
147-
var updater = &Updater{
148-
CurrentVersion: version,
149-
ApiURL: *updateUrl,
150-
BinURL: *updateUrl,
151-
DiffURL: "",
152-
Dir: "update/",
153-
CmdName: *appName,
154-
}
155-
156-
if updater != nil {
157-
updater_job := func() {
158-
go updater.BackgroundRun()
159-
}
160-
scheduler.Every(5).Minutes().Run(updater_job)
161-
}
162-
}
163-
164143
log.Println("Version:" + version)
165144

166145
// hostname
@@ -245,6 +224,7 @@ func main() {
245224
r.GET("/info", infoHandler)
246225
r.POST("/killbrowser", killBrowserHandler)
247226
r.POST("/pause", pauseHandler)
227+
r.POST("/update", updateHandler)
248228

249229
go func() {
250230
// check if certificates exist; if not, use plain http

0 commit comments

Comments
 (0)