Limited maxCards to 4

This commit is contained in:
Artyom Belousov 2019-11-22 17:50:36 +03:00
parent 4e51cfeba5
commit 61302ce9bc
2 changed files with 2 additions and 12 deletions

View file

@ -11,6 +11,7 @@ import (
const Scgurl = "https://www.starcitygames.com/search.php?search_query="
const Scgapi = "https://newstarcityconnector.herokuapp.com/eyApi/products/"
const MaxCards = 4
func GetSCGPrices(name string) ([]CardPrice, error) {
preprocessedName := preprocessNameForSearch(name)
@ -27,7 +28,7 @@ func preprocessNameForSearch(name string) string {
}
func fetchPrices(doc *html.Node) ([]CardPrice, error) {
priceContainers := getPriceContainers(doc)
priceContainers := getPriceContainers(doc)[:MaxCards]
length := len(priceContainers)
prices := make(chan CardPrice, length)
finished := make(chan bool, length)