diff --git a/ratel/import.go b/ratel/import.go index 73404cc..3b1774c 100644 --- a/ratel/import.go +++ b/ratel/import.go @@ -12,13 +12,14 @@ const maxLen = 500000000 // Import accepts an event func (r *T) Import(rr io.Reader) { r.Flatten = true + var err er scan := bufio.NewScanner(rr) buf := make(by, maxLen) scan.Buffer(buf, maxLen) - var err er - var count no + var count, total no for scan.Scan() { b := scan.Bytes() + total += len(b) + 1 if len(b) < 1 { continue } @@ -35,6 +36,7 @@ func (r *T) Import(rr io.Reader) { chk.T(r.DB.RunValueLogGC(0.5)) } } + log.I.F("read %d bytes and saved %d events", total, count) err = scan.Err() if chk.E(err) { } diff --git a/realy/server.go b/realy/server.go index 49cc19e..0363073 100644 --- a/realy/server.go +++ b/realy/server.go @@ -104,8 +104,9 @@ func (s *Server) Start(host st, port int, started ...chan bo) er { } s.Addr = ln.Addr().String() s.httpServer = &http.Server{Handler: cors.Default().Handler(s), Addr: addr, - WriteTimeout: 7 * time.Second, ReadTimeout: 7 * time.Second, - IdleTimeout: 28 * time.Second} + //WriteTimeout: 7 * time.Second, + ReadHeaderTimeout: 7 * time.Second, + IdleTimeout: 28 * time.Second} for _, startedC := range started { close(startedC) } diff --git a/realy/version b/realy/version index bb8edae..1b0c03e 100644 --- a/realy/version +++ b/realy/version @@ -1 +1 @@ -v1.3.2 \ No newline at end of file +v1.3.3 \ No newline at end of file