Reset cache if token expire

This commit is contained in:
2022-01-17 21:28:33 +01:00
parent 1688bd074c
commit ab9712b05b

View File

@@ -1,11 +1,12 @@
import Logger from '@ioc:Adonis/Core/Logger'
import { getCurrentPlayingFromSpotify, getSpotifyAccount } from 'App/Utils/SongUtils'
import { getCurrentPlayingFromSpotify, getSpotifyAccount, resetCurrentSongCache } from 'App/Utils/SongUtils'
const MS = 1000
let taskId
async function SpotifyCurrentListeningWatcher(): Promise<void> {
if ((await getSpotifyAccount()).access_token === '') return
if ((await getSpotifyAccount()).access_token === '')
await resetCurrentSongCache()
await getCurrentPlayingFromSpotify()
}