Skip to content

Commit

Permalink
fix #53
Browse files Browse the repository at this point in the history
  • Loading branch information
iwannay committed Aug 24, 2019
1 parent 6ffa980 commit 56ccaef
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## v2.0.4
1.修复常驻任务无法删除
2.修复查看日志在特殊情况下日志异常

## v2.0.3
1.修复特定情况下节点失去连接
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/go-check/check v1.0.0-20180628173108-788fd7840127 // indirect
github.com/gofrs/uuid v3.2.0+incompatible
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c // indirect
github.com/gorilla/schema v1.1.0 // indirect
github.com/imkira/go-interpol v1.1.0 // indirect
Expand Down Expand Up @@ -57,7 +56,6 @@ require (
github.com/xeipuuv/gojsonschema v1.1.0 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
github.com/yudai/pp v2.0.1+incompatible // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -217,8 +215,6 @@ github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJx
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
github.com/yudai/pp v2.0.1+incompatible h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
Expand Down
9 changes: 4 additions & 5 deletions jiacrontabd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,13 @@ func (cu *cmdUint) exec() error {
cu.writeLog(cu.content)
go func() {
var (
err error
line []byte
)

for {

line, err = reader.ReadBytes('\n')
if err != nil || err == io.EOF {
line, _ = reader.ReadBytes('\n')
if len(line) == 0 {
break
}

Expand All @@ -172,8 +171,8 @@ func (cu *cmdUint) exec() error {
}

for {
line, err = readerErr.ReadBytes('\n')
if err != nil || err == io.EOF {
line, _ = readerErr.ReadBytes('\n')
if len(line) == 0 {
break
}
// 默认给err信息加上日期标志
Expand Down
11 changes: 8 additions & 3 deletions pkg/finder/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ func (fd *Finder) find(fpath string, modifyTime time.Time) error {

for {

bts, err := reader.ReadBytes('\n')
if err != nil {
bts, _ := reader.ReadBytes('\n')

if len(bts) == 0 {
break
}

Expand All @@ -112,6 +113,9 @@ func (fd *Finder) find(fpath string, modifyTime time.Time) error {
}

if fd.isTail {
if fd.offset == 0 {
bts = append(bts, '\n')
}
invert(bts)
}

Expand All @@ -124,11 +128,12 @@ func (fd *Finder) find(fpath string, modifyTime time.Time) error {
break
}

if fd.offset == 0 {
if fd.offset <= 0 {
break
}

}

if len(matchData) > 0 {
fd.matchDataQueue = append(fd.matchDataQueue, matchDataChunk{
modifyTime: modifyTime,
Expand Down

0 comments on commit 56ccaef

Please sign in to comment.