mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 22:51:29 +00:00
avoid unnecessary read of large log file
If w.MaxLines is not set, there is no need to calc large log file’s lines. It may takes more than 10mins to calc a 10G file.
This commit is contained in:
parent
e211e4839c
commit
80fa51468c
@ -182,7 +182,7 @@ func (w *fileLogWriter) initFd() error {
|
||||
if w.Daily {
|
||||
go w.dailyRotate(w.dailyOpenTime)
|
||||
}
|
||||
if fInfo.Size() > 0 {
|
||||
if fInfo.Size() > 0 && w.MaxLines > 0 {
|
||||
count, err := w.lines()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user