revid: adding debug prints

This commit is contained in:
saxon 2018-09-24 20:21:49 +09:30
parent 724042baeb
commit 195f52ae16
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ LICENSE
package revid
import (
"fmt"
"io"
"os"
"os/exec"
@ -122,6 +123,7 @@ func (s *httpSender) load(c *ring.Chunk) error {
func (s *httpSender) send() error {
if s.chunk == nil {
fmt.Println("chunk is nil")
// Do not retry with httpSender,
// so just return without error
// if the chunk has been cleared.
@ -133,6 +135,7 @@ func (s *httpSender) send() error {
pins := netsender.MakePins(ip, "V")
for i, pin := range pins {
if pin.Name == "V0" {
fmt.Println("pin is V0")
send = true
pins[i].Value = s.chunk.Len()
pins[i].Data = s.chunk.Bytes()
@ -142,6 +145,7 @@ func (s *httpSender) send() error {
}
var err error
if send {
fmt.Println("sending")
_, _, err = s.client.Send(netsender.RequestPoll, pins)
}
// We will not retry, so release