From 97f5ef70acd6ea7825f0495a467569a0434f5c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 28 Nov 2020 17:56:49 +0100 Subject: [PATCH] refactor(api): improve function naming in spotify source --- src/sources/spotify/spotify.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sources/spotify/spotify.service.ts b/src/sources/spotify/spotify.service.ts index b022839..f9a65b4 100644 --- a/src/sources/spotify/spotify.service.ts +++ b/src/sources/spotify/spotify.service.ts @@ -32,20 +32,20 @@ export class SpotifyService { } @Interval(20 * 1000) - async getRecentlyPlayedTracks(): Promise { + async runCrawlerForAllUsers(): Promise { this.logger.debug("Starting Spotify crawler loop"); const users = await this.usersService.findAll(); for (const user of users) { - await this.processUser(user); + await this.crawlListensForUser(user); } } - async processUser( + async crawlListensForUser( user: User, retryOnExpiredToken: boolean = true ): Promise { - this.logger.debug(`Importing recently played track for user "${user.id}"`); + this.logger.debug(`Crawling recently played tracks for user "${user.id}"`); let playHistory: PlayHistoryObject[]; try { @@ -59,7 +59,7 @@ export class SpotifyService { ...user.spotify, accessToken, }); - await this.processUser(user, false); + await this.crawlListensForUser(user, false); } else { // TODO sent to sentry this.logger.error(