Increase pageSize to 500 for artist API calls
CI/CD / test (push) Successful in 40s
CI/CD / build (push) Successful in 44s
CI/CD / docker (push) Failing after 49s

Fetch up to 500 tracks/albums per page instead of 50, reducing
the number of API calls needed when checking artists with large
discographies.
This commit is contained in:
Mrixs committed 2026-10-18 09:17:29 +03:00
1 parent c228e7e2b7
commit 7ddf43158a
1 file changed
+2 -2
+2 -2
View File
@@ -137,7 +137,7 @@ func (m *Monitor) checkArtist(ctx context.Context, artistID int) {
// checkArtistTracks checks for new tracks from an artist // checkArtistTracks checks for new tracks from an artist
func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistName string) { func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistName string) {
page := 0 page := 0
pageSize := 50 pageSize := 500
for { for {
tracks, err := m.yandexClient.GetArtistTracks(ctx, artistID, page, pageSize) tracks, err := m.yandexClient.GetArtistTracks(ctx, artistID, page, pageSize)
@@ -175,7 +175,7 @@ func (m *Monitor) checkArtistTracks(ctx context.Context, artistID int, artistNam
// checkArtistAlbums checks for new albums from an artist // checkArtistAlbums checks for new albums from an artist
func (m *Monitor) checkArtistAlbums(ctx context.Context, artistID int, artistName string) { func (m *Monitor) checkArtistAlbums(ctx context.Context, artistID int, artistName string) {
page := 0 page := 0
pageSize := 50 pageSize := 500
for { for {
albums, err := m.yandexClient.GetArtistAlbums(ctx, artistID, page, pageSize) albums, err := m.yandexClient.GetArtistAlbums(ctx, artistID, page, pageSize)