mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
Decimal support for events.stream.output.rotate.when
This commit is contained in:
parent
fc7d8d22b4
commit
251dbb3ef2
4 changed files with 28 additions and 6 deletions
|
@ -167,7 +167,7 @@ func (s *EventsStream) doRotation() {
|
|||
doRotate := false
|
||||
if info, err := s.output.Stat(); err == nil {
|
||||
if s.rotation.How == "size" {
|
||||
doRotate = info.Size() >= int64(s.rotation.Period)
|
||||
doRotate = float64(info.Size()) >= float64(s.rotation.Period*1024*1024)
|
||||
} else if s.rotation.How == "time" {
|
||||
doRotate = info.ModTime().Unix()%int64(s.rotation.Period) == 0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue