File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,15 @@ func (a *TsExtractor) ExportTSToS3(
128128 writer .Close ()
129129 defer writer .Delete ()
130130
131- destinationKey := fmt .Sprintf ("%s/%s.csv" , from .Format ("2006-01-02" ), from .Format ("2006-01-02-15-04" ))
131+ var formattedFrom string
132+ if resolution == 3600 {
133+ formattedFrom = from .Format ("2006-01-02-15-00" )
134+ } else if resolution > 3600 {
135+ formattedFrom = from .Format ("2006-01-02-00-00" )
136+ } else {
137+ formattedFrom = from .Format ("2006-01-02-15-04" )
138+ }
139+ destinationKey := fmt .Sprintf ("%s/%s.csv" , from .Format ("2006-01-02" ), formattedFrom )
132140 a .logger .Infof ("Uploading file %s to bucket %s\n " , destinationKey , s3cl .DestinationBucket ())
133141 if err := s3cl .WriteFile (ctx , destinationKey , writer .GetFilePath ()); err != nil {
134142 return err
You can’t perform that action at this time.
0 commit comments