feat(api): custom spotify crawler interval

This commit is contained in:
Julian Tölle 2020-11-28 18:28:38 +01:00
parent 97f5ef70ac
commit 66fd6ce1b4
6 changed files with 46 additions and 4 deletions

View file

@ -15,5 +15,6 @@ import { SpotifyService } from "./spotify.service";
SpotifyAuthModule,
],
providers: [SpotifyService],
exports: [SpotifyService],
})
export class SpotifyModule {}

View file

@ -1,5 +1,4 @@
import { Injectable } from "@nestjs/common";
import { Interval } from "@nestjs/schedule";
import { ListensService } from "../../listens/listens.service";
import { Logger } from "../../logger/logger.service";
import { Album } from "../../music-library/album.entity";
@ -31,7 +30,6 @@ export class SpotifyService {
this.logger.setContext(this.constructor.name);
}
@Interval(20 * 1000)
async runCrawlerForAllUsers(): Promise<void> {
this.logger.debug("Starting Spotify crawler loop");
const users = await this.usersService.findAll();