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

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: self review 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // 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 executions an execution, moving it from the
dnj (Google) 2016/06/09 18:00:56 nit: executions an execution!
iannucci 2016/06/15 00:46:01 Done.
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

Powered by Google App Engine
This is Rietveld 408576698