From 15b604c92031898a53918f3704a78b7095df527d Mon Sep 17 00:00:00 2001 From: Peter Wang <31591491+peterwjp2017@users.noreply.github.com> Date: Wed, 1 Jul 2020 13:09:45 +0800 Subject: [PATCH] Cut file slice by hour --- file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/file.go b/file.go index 2285bb6..279a970 100644 --- a/file.go +++ b/file.go @@ -329,7 +329,7 @@ func (fw *FileWriter) sliceByDate(dataSlice string) error { oldFilename = strings.Replace(filename, filenameSuffix, "", 1) + "_" + startTime.Format("20060102") + filenameSuffix } if (dataSlice == FILE_SLICE_DATE_HOUR) && - (startTime.Format("2006010215") != startTime.Format("2006010215")) { + (startTime.Format("2006010215") != nowTime.Format("2006010215")) { isHaveSlice = true oldFilename = strings.Replace(filename, filenameSuffix, "", 1) + "_" + startTime.Format("2006010215") + filenameSuffix }