Skip to content

Commit 9d77062

Browse files
committed
added constant for retry count
1 parent 81b48e2 commit 9d77062

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

business/tsextractor/tsextractor.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
)
3535

3636
const importConcurrency = 10
37+
const retryCount = 5
3738

3839
type TsExtractor struct {
3940
iotcl *iot.Client
@@ -152,7 +153,7 @@ func (a *TsExtractor) populateNumericTSDataIntoS3(
152153
var batched *iotclient.ArduinoSeriesBatch
153154
var err error
154155
var retry bool
155-
for i := 0; i < 3; i++ {
156+
for i := 0; i < retryCount; i++ {
156157
batched, retry, err = a.iotcl.GetTimeSeriesByThing(ctx, thingID, from, to, int64(resolution))
157158
if !retry {
158159
break
@@ -254,7 +255,7 @@ func (a *TsExtractor) populateStringTSDataIntoS3(
254255
var batched *iotclient.ArduinoSeriesBatchSampled
255256
var err error
256257
var retry bool
257-
for i := 0; i < 3; i++ {
258+
for i := 0; i < retryCount; i++ {
258259
batched, retry, err = a.iotcl.GetTimeSeriesStringSampling(ctx, stringProperties, from, to, int32(resolution))
259260
if !retry {
260261
break
@@ -314,7 +315,7 @@ func (a *TsExtractor) populateRawTSDataIntoS3(
314315
var batched *iotclient.ArduinoSeriesRawBatch
315316
var err error
316317
var retry bool
317-
for i := 0; i < 3; i++ {
318+
for i := 0; i < retryCount; i++ {
318319
batched, retry, err = a.iotcl.GetRawTimeSeriesByThing(ctx, thingID, from, to)
319320
if !retry {
320321
break

0 commit comments

Comments
 (0)