diff --git a/cloud/aws/s3inventory/parquet_reader.go b/cloud/aws/s3inventory/parquet_reader.go index cc3ca586cfb..1d74f49e75a 100644 --- a/cloud/aws/s3inventory/parquet_reader.go +++ b/cloud/aws/s3inventory/parquet_reader.go @@ -94,8 +94,9 @@ func set(o *InventoryObject, f string, v interface{}) error { case lastModifiedDateFieldName: var lastModifiedMillis int64 lastModifiedMillis, err = cast.ToInt64E(v) - seconds := lastModifiedMillis / int64(time.Second/time.Millisecond) - ns := (lastModifiedMillis % 1000) * int64(time.Millisecond/time.Nanosecond) + secToMS := int64(time.Second / time.Millisecond) + seconds := lastModifiedMillis / secToMS + ns := (lastModifiedMillis % secToMS) * int64(time.Millisecond/time.Nanosecond) o.LastModified = swag.Time(time.Unix(seconds, ns)) case eTagFieldName: o.Checksum, err = cast.ToStringE(v) diff --git a/gateway/simulator/simulation_recorder.go b/gateway/simulator/simulation_recorder.go index 5ffe857ee46..3ec1e4d48e2 100644 --- a/gateway/simulator/simulation_recorder.go +++ b/gateway/simulator/simulation_recorder.go @@ -54,7 +54,8 @@ func (r *recordingBodyReader) Close() error { // RECORDING -var uniquenessCounter int32 // persistent request counter during run. used only below, +var uniquenessCounter int32 // persistent request counter during run. used only below, +const counterLogMax = 100000 // The counterLogMax request will zero the logged count func RegisterRecorder(next http.Handler, authService GatewayAuthService, region, bareDomain string) http.Handler { logger := logging.Default() @@ -81,7 +82,7 @@ func RegisterRecorder(next http.Handler, authService GatewayAuthService, region, createConfFile(r, authService, region, bareDomain, recordingDir) } timeStr := time.Now().Format("15-04-05") - nameBase := timeStr + fmt.Sprintf("-%05d", (uniqueCount%100000)) + nameBase := timeStr + fmt.Sprintf("-%05d", uniqueCount%counterLogMax) respWriter := new(ResponseWriter) respWriter.OriginalWriter = w respWriter.ResponseLog = NewLazyOutput(filepath.Join(recordingDir, nameBase+ResponseExtension))