mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(confg): reload on save and refactor logging (#275)
* feat(confg): reload on save * refactor(logging): rework
This commit is contained in:
parent
198528a474
commit
91b094f4f4
56 changed files with 995 additions and 873 deletions
|
@ -13,7 +13,6 @@ import (
|
|||
|
||||
"github.com/autobrr/autobrr/internal/domain"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
"golang.org/x/time/rate"
|
||||
)
|
||||
|
||||
|
@ -160,8 +159,7 @@ func (c *client) Do(req *http.Request) (*http.Response, error) {
|
|||
func (c *client) get(url string) (*http.Response, error) {
|
||||
req, err := http.NewRequest(http.MethodGet, url, http.NoBody)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("ggn client request error : %v", url)
|
||||
return nil, err
|
||||
return nil, errors.New(fmt.Sprintf("ggn client request error : %v", url))
|
||||
}
|
||||
|
||||
req.Header.Add("X-API-Key", c.APIKey)
|
||||
|
@ -169,8 +167,7 @@ func (c *client) get(url string) (*http.Response, error) {
|
|||
|
||||
res, err := c.Do(req)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("ggn client request error : %v", url)
|
||||
return nil, err
|
||||
return nil, errors.New(fmt.Sprintf("ggn client request error : %v", url))
|
||||
}
|
||||
|
||||
if res.StatusCode == http.StatusUnauthorized {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue