Skip to content

Commit

Permalink
fix socket timeout settings so upload/download fully works
Browse files Browse the repository at this point in the history
  • Loading branch information
mleku committed Dec 10, 2024
1 parent 084d9f5 commit 0e9e2f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions ratel/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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) {
}
Expand Down
5 changes: 3 additions & 2 deletions realy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion realy/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.2
v1.3.3

0 comments on commit 0e9e2f8

Please sign in to comment.