Skip to content

Commit

Permalink
Better live standard output.
Browse files Browse the repository at this point in the history
  • Loading branch information
cube2222 committed Aug 2, 2020
1 parent 8739259 commit bfb380b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions output/batch/stdout.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func NewLiveTablePrinter(stateStorage storage.Storage, recordsLister RecordsList
}

func (printer *LiveTablePrinter) Run(ctx context.Context) error {
writer := uilive.New()
liveWriter := uilive.New()

for range time.Tick(REFRESH_DELAY) {
tx := printer.stateStorage.BeginTransaction()
Expand Down Expand Up @@ -79,8 +79,8 @@ func (printer *LiveTablePrinter) Run(ctx context.Context) error {
return errors.Wrap(err, "couldn't format table")
}

buf.WriteTo(writer)
writer.Flush()
buf.WriteTo(liveWriter)
liveWriter.Flush()

tx.Abort()

Expand Down

0 comments on commit bfb380b

Please sign in to comment.