mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
parent
b7ba401c0b
commit
88cabb9e0a
@ -385,15 +385,17 @@ func (s *Service) sendUsageReport(ctx context.Context) error {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
req, err := http.NewRequest("POST", s.cfg.Options().URURL, &b)
|
req, err := http.NewRequest("POST", s.cfg.Options().URURL, &b)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
req.Header.Set("Content-Type", "application/json")
|
return err
|
||||||
req.Cancel = ctx.Done()
|
|
||||||
var resp *http.Response
|
|
||||||
resp, err = client.Do(req)
|
|
||||||
resp.Body.Close()
|
|
||||||
}
|
}
|
||||||
|
req.Header.Set("Content-Type", "application/json")
|
||||||
return err
|
req.Cancel = ctx.Done()
|
||||||
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
resp.Body.Close()
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Service) serve(ctx context.Context) {
|
func (s *Service) serve(ctx context.Context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user