fix: survey 包修复 All 函数无用的返回参

This commit is contained in:
kercylan98 2023-08-25 15:23:53 +08:00
parent 0d765075e0
commit c6f8c19086
1 changed files with 3 additions and 5 deletions

View File

@ -60,9 +60,7 @@ func Reg(name, filePath string, options ...Option) {
survey[n].flush() survey[n].flush()
} }
timerSurveyLock.Unlock() timerSurveyLock.Unlock()
if !t.Reset(interval) { t.Reset(interval)
break
}
} }
}(logger.interval) }(logger.interval)
} }
@ -129,7 +127,7 @@ func Close(names ...string) {
// All 处理特定记录器特定日期的所有记录,当发生错误时,会发生 panic // All 处理特定记录器特定日期的所有记录,当发生错误时,会发生 panic
// - handle 为并行执行的,需要自行处理并发安全 // - handle 为并行执行的,需要自行处理并发安全
func All(name string, t time.Time, handle func(record R) bool) { func All(name string, t time.Time, handle func(record R)) {
timerSurveyLock.Lock() timerSurveyLock.Lock()
logger := survey[name] logger := survey[name]
timerSurveyLock.Unlock() timerSurveyLock.Unlock()
@ -150,7 +148,7 @@ func All(name string, t time.Time, handle func(record R) bool) {
// AllWithPath 处理特定记录器特定日期的所有记录,当发生错误时,会发生 panic // AllWithPath 处理特定记录器特定日期的所有记录,当发生错误时,会发生 panic
// - handle 为并行执行的,需要自行处理并发安全 // - handle 为并行执行的,需要自行处理并发安全
// - 适用于外部进程对于日志文件的读取,但是需要注意的是,此时日志文件可能正在被写入,所以可能会读取到错误的数据 // - 适用于外部进程对于日志文件的读取,但是需要注意的是,此时日志文件可能正在被写入,所以可能会读取到错误的数据
func AllWithPath(filePath string, handle func(record R) bool) { func AllWithPath(filePath string, handle func(record R)) {
err := file.ReadLineWithParallel(filePath, 1*1024*1024*1024, func(s string) { err := file.ReadLineWithParallel(filePath, 1*1024*1024*1024, func(s string) {
handle(R(s)) handle(R(s))
}) })