@@ -34,6 +34,7 @@ import (
34
34
)
35
35
36
36
const importConcurrency = 10
37
+ const retryCount = 5
37
38
38
39
type TsExtractor struct {
39
40
iotcl * iot.Client
@@ -117,6 +118,7 @@ func (a *TsExtractor) ExportTSToS3(
117
118
defer writer .Delete ()
118
119
119
120
destinationKey := fmt .Sprintf ("%s/%s.csv" , from .Format ("2006-01-02" ), from .Format ("2006-01-02-15" ))
121
+ a .logger .Infof ("Uploading file %s to bucket %s\n " , destinationKey , s3cl .DestinationBucket ())
120
122
if err := s3cl .WriteFile (ctx , destinationKey , writer .GetFilePath ()); err != nil {
121
123
return err
122
124
}
@@ -151,7 +153,7 @@ func (a *TsExtractor) populateNumericTSDataIntoS3(
151
153
var batched * iotclient.ArduinoSeriesBatch
152
154
var err error
153
155
var retry bool
154
- for i := 0 ; i < 3 ; i ++ {
156
+ for i := 0 ; i < retryCount ; i ++ {
155
157
batched , retry , err = a .iotcl .GetTimeSeriesByThing (ctx , thingID , from , to , int64 (resolution ))
156
158
if ! retry {
157
159
break
@@ -253,7 +255,7 @@ func (a *TsExtractor) populateStringTSDataIntoS3(
253
255
var batched * iotclient.ArduinoSeriesBatchSampled
254
256
var err error
255
257
var retry bool
256
- for i := 0 ; i < 3 ; i ++ {
258
+ for i := 0 ; i < retryCount ; i ++ {
257
259
batched , retry , err = a .iotcl .GetTimeSeriesStringSampling (ctx , stringProperties , from , to , int32 (resolution ))
258
260
if ! retry {
259
261
break
@@ -313,7 +315,7 @@ func (a *TsExtractor) populateRawTSDataIntoS3(
313
315
var batched * iotclient.ArduinoSeriesRawBatch
314
316
var err error
315
317
var retry bool
316
- for i := 0 ; i < 3 ; i ++ {
318
+ for i := 0 ; i < retryCount ; i ++ {
317
319
batched , retry , err = a .iotcl .GetRawTimeSeriesByThing (ctx , thingID , from , to )
318
320
if ! retry {
319
321
break
0 commit comments