Skip to content

Commit

Permalink
db: Just warning when failed to fetch Swagger YALM URL
Browse files Browse the repository at this point in the history
  • Loading branch information
ish-hcc committed Nov 1, 2024
1 parent 5fd3258 commit e02afae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/taskComponent.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/jollaman999/utils/logger"
"gorm.io/gorm"
"io"
"net/http"
Expand Down Expand Up @@ -175,7 +176,8 @@ func TaskComponentInit() error {

spec, err := fetchAndParseYAML(connection, configFile.SwaggerYAMLEndpoint)
if err != nil {
return fmt.Errorf("failed to fetch and parse swagger spec: %v", err)
logger.Println(logger.WARN, true, fmt.Sprintf("failed to fetch and parse swagger spec: %v", err))
continue
}

endpoint := strings.TrimPrefix(configFile.Endpoint, spec.BasePath)
Expand Down

0 comments on commit e02afae

Please sign in to comment.