Fixed bug with limiting card amount
This commit is contained in:
parent
61302ce9bc
commit
8d0e5ed4db
1 changed files with 4 additions and 1 deletions
|
|
@ -28,7 +28,10 @@ func preprocessNameForSearch(name string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchPrices(doc *html.Node) ([]CardPrice, error) {
|
func fetchPrices(doc *html.Node) ([]CardPrice, error) {
|
||||||
priceContainers := getPriceContainers(doc)[:MaxCards]
|
priceContainers := getPriceContainers(doc)
|
||||||
|
if MaxCards < len(priceContainers) {
|
||||||
|
priceContainers = priceContainers[:MaxCards]
|
||||||
|
}
|
||||||
length := len(priceContainers)
|
length := len(priceContainers)
|
||||||
prices := make(chan CardPrice, length)
|
prices := make(chan CardPrice, length)
|
||||||
finished := make(chan bool, length)
|
finished := make(chan bool, length)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue