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

Side by Side Diff: appengine/cmd/dm/mutate/activate_execution.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fix imports and make dummy.go a real file Created 4 years, 6 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/cmd/dm/mutate/ack_fwd_dep_test.go ('k') | appengine/cmd/dm/mutate/add_backdep.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file.
4
5 package mutate
6
7 import (
8 "golang.org/x/net/context"
9
10 "github.com/luci/gae/service/datastore"
11 "github.com/luci/luci-go/appengine/cmd/dm/model"
12 "github.com/luci/luci-go/appengine/tumble"
13 "github.com/luci/luci-go/common/api/dm/service/v1"
14 )
15
16 // ActivateExecution executes an execution, moving it from the
17 // SCHEDULING->RUNNING state, and resetting the execution timeout (if any).
18 type ActivateExecution struct {
19 Auth *dm.Execution_Auth
20 NewTok []byte
21 }
22
23 // Root implements tumble.Mutation.
24 func (a *ActivateExecution) Root(c context.Context) *datastore.Key {
25 return model.AttemptKeyFromID(c, a.Auth.Id.AttemptID())
26 }
27
28 // RollForward implements tumble.Mutation
29 func (a *ActivateExecution) RollForward(c context.Context) (muts []tumble.Mutati on, err error) {
30 _, e, err := model.ActivateExecution(c, a.Auth, a.NewTok)
31 if err == nil {
32 err = ResetExecutionTimeout(c, e)
33 }
34 return
35 }
36
37 func init() {
38 tumble.Register((*ActivateExecution)(nil))
39 }
OLDNEW
« no previous file with comments | « appengine/cmd/dm/mutate/ack_fwd_dep_test.go ('k') | appengine/cmd/dm/mutate/add_backdep.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698