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

Side by Side Diff: milo/common/config.go

Issue 2981373002: Milo console importer: fix small bug (Closed)
Patch Set: derp Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. 1 // Copyright 2016 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 }) 336 })
337 if err != nil { 337 if err != nil {
338 merr = append(merr, err) 338 merr = append(merr, err)
339 } else if err := datastore.Delete(c, toDelete); err != nil { 339 } else if err := datastore.Delete(c, toDelete); err != nil {
340 merr = append(merr, err) 340 merr = append(merr, err)
341 } 341 }
342 342
343 // Print some stats. 343 // Print some stats.
344 processedConsoles := 0 344 processedConsoles := 0
345 for _, cons := range knownProjects { 345 for _, cons := range knownProjects {
346 » » processedConsoles += cons.Len() 346 » » if cons != nil {
347 » » » processedConsoles += cons.Len()
348 » » }
347 } 349 }
348 logging.Infof( 350 logging.Infof(
349 c, "processed %d consoles over %d projects", len(knownProjects), processedConsoles) 351 c, "processed %d consoles over %d projects", len(knownProjects), processedConsoles)
350 352
351 if len(merr) == 0 { 353 if len(merr) == 0 {
352 return nil 354 return nil
353 } 355 }
354 return merr 356 return merr
355 } 357 }
356 358
(...skipping 12 matching lines...) Expand all
369 // GetConsole returns the requested console. 371 // GetConsole returns the requested console.
370 func GetConsole(c context.Context, proj, id string) (*Console, error) { 372 func GetConsole(c context.Context, proj, id string) (*Console, error) {
371 // TODO(hinoka): Memcache this. 373 // TODO(hinoka): Memcache this.
372 con := Console{ 374 con := Console{
373 Parent: datastore.MakeKey(c, "Project", proj), 375 Parent: datastore.MakeKey(c, "Project", proj),
374 ID: id, 376 ID: id,
375 } 377 }
376 err := datastore.Get(c, &con) 378 err := datastore.Get(c, &con)
377 return &con, err 379 return &con, err
378 } 380 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698