Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: scheduler/appengine/engine/cron/demo/main.go

Issue 2988413002: [tq] Move to top-level package. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/tq/tq_test.go ('k') | scheduler/appengine/engine/tq/tq.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « appengine/tq/tq_test.go ('k') | scheduler/appengine/engine/tq/tq.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698