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