| OLD | NEW |
| 1 // Copyright 2017 The LUCI Authors. | 1 // Copyright 2017 The LUCI Authors. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 "github.com/golang/protobuf/proto" | 24 "github.com/golang/protobuf/proto" |
| 25 "github.com/luci/gae/service/datastore" | 25 "github.com/luci/gae/service/datastore" |
| 26 | 26 |
| 27 "github.com/luci/luci-go/appengine/gaemiddleware" | 27 "github.com/luci/luci-go/appengine/gaemiddleware" |
| 28 "github.com/luci/luci-go/common/clock" | 28 "github.com/luci/luci-go/common/clock" |
| 29 "github.com/luci/luci-go/common/data/rand/mathrand" | 29 "github.com/luci/luci-go/common/data/rand/mathrand" |
| 30 "github.com/luci/luci-go/common/logging" | 30 "github.com/luci/luci-go/common/logging" |
| 31 "github.com/luci/luci-go/server/router" | 31 "github.com/luci/luci-go/server/router" |
| 32 | 32 |
| 33 "github.com/luci/luci-go/appengine/tq" |
| 33 "github.com/luci/luci-go/scheduler/appengine/engine/cron" | 34 "github.com/luci/luci-go/scheduler/appengine/engine/cron" |
| 34 "github.com/luci/luci-go/scheduler/appengine/engine/internal" | 35 "github.com/luci/luci-go/scheduler/appengine/engine/internal" |
| 35 "github.com/luci/luci-go/scheduler/appengine/engine/tq" | |
| 36 "github.com/luci/luci-go/scheduler/appengine/schedule" | 36 "github.com/luci/luci-go/scheduler/appengine/schedule" |
| 37 ) | 37 ) |
| 38 | 38 |
| 39 var tasks = tq.Dispatcher{} | 39 var tasks = tq.Dispatcher{} |
| 40 | 40 |
| 41 type CronState struct { | 41 type CronState struct { |
| 42 _extra datastore.PropertyMap `gae:"-,extra"` | 42 _extra datastore.PropertyMap `gae:"-,extra"` |
| 43 | 43 |
| 44 ID string `gae:"$id"` | 44 ID string `gae:"$id"` |
| 45 State cron.State `gae:",noindex"` | 45 State cron.State `gae:",noindex"` |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 r.GET("/start/:JobID", gaemiddleware.BaseProd(), func(c *router.Context)
{ | 149 r.GET("/start/:JobID", gaemiddleware.BaseProd(), func(c *router.Context)
{ |
| 150 jobID := c.Params.ByName("JobID") | 150 jobID := c.Params.ByName("JobID") |
| 151 if err := startJob(c.Context, jobID); err != nil { | 151 if err := startJob(c.Context, jobID); err != nil { |
| 152 panic(err) | 152 panic(err) |
| 153 } | 153 } |
| 154 }) | 154 }) |
| 155 | 155 |
| 156 http.DefaultServeMux.Handle("/", r) | 156 http.DefaultServeMux.Handle("/", r) |
| 157 } | 157 } |
| OLD | NEW |