Skip to content

Commit 472e63f

Browse files
committed
fix los apps
1 parent 31ce98c commit 472e63f

File tree

4 files changed

+24
-40
lines changed

4 files changed

+24
-40
lines changed

tests/slo/database/sql/storage.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,9 @@ func (s *Storage) Read(ctx context.Context, entryID generator.RowID) (res genera
139139
retry.WithIdempotent(true),
140140
retry.WithTrace(
141141
&trace.Retry{
142-
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
143-
return func(info trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
144-
return func(info trace.RetryLoopDoneInfo) {
145-
attempts = info.Attempts
146-
}
142+
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopDoneInfo) {
143+
return func(info trace.RetryLoopDoneInfo) {
144+
attempts = info.Attempts
147145
}
148146
},
149147
},
@@ -179,11 +177,9 @@ func (s *Storage) Write(ctx context.Context, e generator.Row) (attempts int, err
179177
retry.WithIdempotent(true),
180178
retry.WithTrace(
181179
&trace.Retry{
182-
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
183-
return func(info trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
184-
return func(info trace.RetryLoopDoneInfo) {
185-
attempts = info.Attempts
186-
}
180+
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopDoneInfo) {
181+
return func(info trace.RetryLoopDoneInfo) {
182+
attempts = info.Attempts
187183
}
188184
},
189185
},

tests/slo/gorm/storage.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ func (s *Storage) Read(ctx context.Context, id generator.RowID) (r generator.Row
110110
retry.WithIdempotent(true),
111111
retry.WithTrace(
112112
&trace.Retry{
113-
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
114-
return func(info trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
115-
return func(info trace.RetryLoopDoneInfo) {
116-
attempts = info.Attempts
117-
}
113+
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopDoneInfo) {
114+
return func(info trace.RetryLoopDoneInfo) {
115+
attempts = info.Attempts
118116
}
119117
},
120118
},
@@ -158,11 +156,9 @@ func (s *Storage) Write(ctx context.Context, row generator.Row) (attempts int, e
158156
retry.WithIdempotent(true),
159157
retry.WithTrace(
160158
&trace.Retry{
161-
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
162-
return func(info trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
163-
return func(info trace.RetryLoopDoneInfo) {
164-
attempts = info.Attempts
165-
}
159+
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopDoneInfo) {
160+
return func(info trace.RetryLoopDoneInfo) {
161+
attempts = info.Attempts
166162
}
167163
},
168164
},

tests/slo/native/table/storage.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,9 @@ func (s *Storage) Read(ctx context.Context, entryID generator.RowID) (_ generato
142142
},
143143
table.WithIdempotent(),
144144
table.WithTrace(trace.Table{
145-
OnDo: func(info trace.TableDoStartInfo) func(info trace.TableDoIntermediateInfo) func(trace.TableDoDoneInfo) {
146-
return func(info trace.TableDoIntermediateInfo) func(trace.TableDoDoneInfo) {
147-
return func(info trace.TableDoDoneInfo) {
148-
attempts = info.Attempts
149-
}
145+
OnDo: func(info trace.TableDoStartInfo) func(trace.TableDoDoneInfo) {
146+
return func(info trace.TableDoDoneInfo) {
147+
attempts = info.Attempts
150148
}
151149
},
152150
}),
@@ -190,11 +188,9 @@ func (s *Storage) Write(ctx context.Context, e generator.Row) (attempts int, _ e
190188
},
191189
table.WithIdempotent(),
192190
table.WithTrace(trace.Table{
193-
OnDo: func(info trace.TableDoStartInfo) func(info trace.TableDoIntermediateInfo) func(trace.TableDoDoneInfo) {
194-
return func(info trace.TableDoIntermediateInfo) func(trace.TableDoDoneInfo) {
195-
return func(info trace.TableDoDoneInfo) {
196-
attempts = info.Attempts
197-
}
191+
OnDo: func(info trace.TableDoStartInfo) func(trace.TableDoDoneInfo) {
192+
return func(info trace.TableDoDoneInfo) {
193+
attempts = info.Attempts
198194
}
199195
},
200196
}),

tests/slo/xorm/storage.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,9 @@ func (s *Storage) Read(ctx context.Context, id generator.RowID) (row generator.R
141141
retry.WithIdempotent(true),
142142
retry.WithTrace(
143143
&trace.Retry{
144-
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
145-
return func(info trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
146-
return func(info trace.RetryLoopDoneInfo) {
147-
attempts = info.Attempts
148-
}
144+
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopDoneInfo) {
145+
return func(info trace.RetryLoopDoneInfo) {
146+
attempts = info.Attempts
149147
}
150148
},
151149
},
@@ -176,11 +174,9 @@ func (s *Storage) Write(ctx context.Context, row generator.Row) (attempts int, e
176174
retry.WithIdempotent(true),
177175
retry.WithTrace(
178176
&trace.Retry{
179-
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
180-
return func(info trace.RetryLoopIntermediateInfo) func(trace.RetryLoopDoneInfo) {
181-
return func(info trace.RetryLoopDoneInfo) {
182-
attempts = info.Attempts
183-
}
177+
OnRetry: func(info trace.RetryLoopStartInfo) func(trace.RetryLoopDoneInfo) {
178+
return func(info trace.RetryLoopDoneInfo) {
179+
attempts = info.Attempts
184180
}
185181
},
186182
},

0 commit comments

Comments
 (0)