* Add feature flag managment system using split.io and remove viper. * Fixing tests. * Attempt to fix postgres tests. * Fix watch filepath for advanced logging. * Review fixes. * Some error wrapping. * Remove unessisary store interface. * Desanitize SplitKey * Simplify. * Review feedback. * Rename split mlog adatper to split logger. * fsInner * Style. * Restore oldcfg test. * Downgrading non-actionable feature flag errors to warnings. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
12 строки
315 B
Go
12 строки
315 B
Go
package util
|
|
|
|
import "time"
|
|
|
|
const dedupWindowSizeMs = 3600 * 1000
|
|
|
|
// TruncateTimeFrame truncates de time frame received with the time window
|
|
func TruncateTimeFrame(timestampInNs int64) int64 {
|
|
timestampInMs := timestampInNs / int64(time.Millisecond)
|
|
return timestampInMs - (timestampInMs % dedupWindowSizeMs)
|
|
}
|