OLD | NEW |
1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
4 | 4 |
5 package bigtable | 5 package bigtable |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "time" | 9 "time" |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 return false, nil | 40 return false, nil |
41 } | 41 } |
42 | 42 |
43 func waitForTable(ctx context.Context, c *bigtable.AdminClient, name string) err
or { | 43 func waitForTable(ctx context.Context, c *bigtable.AdminClient, name string) err
or { |
44 return retry.Retry(ctx, retry.TransientOnly(retry.Default), func() error
{ | 44 return retry.Retry(ctx, retry.TransientOnly(retry.Default), func() error
{ |
45 exists, err := tableExists(ctx, c, name) | 45 exists, err := tableExists(ctx, c, name) |
46 if err != nil { | 46 if err != nil { |
47 return err | 47 return err |
48 } | 48 } |
49 if !exists { | 49 if !exists { |
50 » » » return errors.WrapTransient(errors.New("table does not e
xist")) | 50 » » » return errors.New("table does not exist", retry.Tag) |
51 } | 51 } |
52 return nil | 52 return nil |
53 }, func(err error, delay time.Duration) { | 53 }, func(err error, delay time.Duration) { |
54 log.Fields{ | 54 log.Fields{ |
55 log.ErrorKey: err, | 55 log.ErrorKey: err, |
56 "delay": delay, | 56 "delay": delay, |
57 }.Warningf(ctx, "Table does not exist yet; retrying.") | 57 }.Warningf(ctx, "Table does not exist yet; retrying.") |
58 }) | 58 }) |
59 } | 59 } |
60 | 60 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 cfg := storage.Config{ | 126 cfg := storage.Config{ |
127 MaxLogAge: DefaultMaxLogAge, | 127 MaxLogAge: DefaultMaxLogAge, |
128 } | 128 } |
129 if err := st.Config(cfg); err != nil { | 129 if err := st.Config(cfg); err != nil { |
130 log.WithError(err).Errorf(ctx, "Failed to push default configura
tion.") | 130 log.WithError(err).Errorf(ctx, "Failed to push default configura
tion.") |
131 return err | 131 return err |
132 } | 132 } |
133 | 133 |
134 return nil | 134 return nil |
135 } | 135 } |
OLD | NEW |