File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
gax-java/gax/src/main/java/com/google/api/gax/tracing Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 29
29
*/
30
30
package com .google .api .gax .tracing ;
31
31
32
+ import static com .google .api .gax .util .TimeConversionUtils .toThreetenDuration ;
33
+
32
34
import com .google .api .core .InternalApi ;
33
35
import com .google .api .core .ObsoleteApi ;
34
36
@@ -121,7 +123,13 @@ default Scope inScope() {
121
123
* @param error the transient error that caused the attempt to fail.
122
124
* @param delay the amount of time to wait before the next attempt will start.
123
125
*/
124
- default void attemptFailedDuration (Throwable error , java .time .Duration delay ) {};
126
+ default void attemptFailedDuration (Throwable error , java .time .Duration delay ) {
127
+ // Defaults to do the same as attemptFailed(Throwable, org.threeten.bp.Duration). This
128
+ // is because customers may have older/legacy code that directly implements
129
+ // attemptFailed(Throwable, org.threeten.bp.Duration)} and their overridden logic should be
130
+ // invoked in gax.
131
+ attemptFailed (error , toThreetenDuration (delay ));
132
+ };
125
133
126
134
/**
127
135
* Adds an annotation that the attempt failed and that no further attempts will be made because
Original file line number Diff line number Diff line change 29
29
*/
30
30
package com .google .api .gax .tracing ;
31
31
32
- import static com .google .api .gax .util .TimeConversionUtils .toThreetenDuration ;
33
-
34
32
import com .google .api .core .InternalApi ;
35
33
import com .google .api .core .ObsoleteApi ;
36
34
@@ -105,12 +103,6 @@ public void attemptCancelled() {
105
103
// noop
106
104
}
107
105
108
- @ Override
109
- public void attemptFailedDuration (Throwable error , java .time .Duration delay ) {
110
- // noop via attemptFailed(Throwable error, org.threeten.Duration)
111
- attemptFailed (error , toThreetenDuration (delay ));
112
- }
113
-
114
106
/**
115
107
* This method is obsolete. Use {@link #attemptFailedDuration(Throwable, java.time.Duration)}
116
108
* instead.
You can’t perform that action at this time.
0 commit comments