auto append sufix to Config.CFClearanceScraper.Url
All checks were successful
docker / prepare-and-build (push) Successful in 3m33s
release / goreleaser (push) Successful in 25m6s

This commit is contained in:
Nite07 2024-11-21 00:59:17 +08:00
parent b138550d9b
commit 08a4aafaf9
2 changed files with 4 additions and 4 deletions

View File

@ -100,6 +100,10 @@ func init() {
Config.OnlineFixAvaliable = Config.OnlineFix.User != "" && Config.OnlineFix.Password != ""
Config.RedisAvaliable = Config.Redis.Host != ""
Config.DatabaseAvaliable = Config.Database.Database != "" && Config.Database.Host != ""
if Config.CFClearanceScraper.Url != "" && !strings.HasSuffix(Config.CFClearanceScraper.Url, "/cf-clearance-scraper") {
Config.CFClearanceScraper.Url += "/cf-clearance-scraper"
}
}
func loadEnvVariables(cfg interface{}) {

View File

@ -96,10 +96,6 @@ func (c *FreeGOGCrawler) Crawl(num int) ([]*model.GameItem, error) {
}
func (c *FreeGOGCrawler) CrawlByUrl(url string, session *utils.WAFSession) (*model.GameItem, error) {
var err error
if err != nil {
return nil, errors.New("Failed to create session")
}
resp, err := utils.FetchWithWAFSession(utils.FetchConfig{
Url: url,
}, session)