From 55b197f64d1ee993b7cb18e08e1363642fdcc68e Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Thu, 14 Apr 2022 22:58:04 +0200 Subject: [PATCH] Patch: delay for Fetch task --- app/Tasks/CurrentSongTask.ts | 2 +- app/Tasks/HistorySongsTask.ts | 2 +- app/Tasks/StatesTask.ts | 2 +- app/Tasks/StatsTask.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Tasks/CurrentSongTask.ts b/app/Tasks/CurrentSongTask.ts index 1f95bb6..a975f48 100644 --- a/app/Tasks/CurrentSongTask.ts +++ b/app/Tasks/CurrentSongTask.ts @@ -1,7 +1,7 @@ import Logger from '@ioc:Adonis/Core/Logger' import { getCurrentPlayingFromSpotify, getSpotifyAccount, resetCurrentSongCache } from 'App/Utils/SongUtils' -const MS = 1000 +const MS = 1000 // 1 second let taskId async function SpotifyCurrentListeningWatcher(): Promise { diff --git a/app/Tasks/HistorySongsTask.ts b/app/Tasks/HistorySongsTask.ts index f05f17f..4c7b9a1 100644 --- a/app/Tasks/HistorySongsTask.ts +++ b/app/Tasks/HistorySongsTask.ts @@ -2,7 +2,7 @@ import Logger from '@ioc:Adonis/Core/Logger' import { getCurrentPlayingFromCache } from 'App/Utils/SongUtils' import Song from 'App/Models/Song' -const MS = 10000 +const MS = 3000 // 3 seconds let taskId async function LogSpotifyHistory(): Promise { diff --git a/app/Tasks/StatesTask.ts b/app/Tasks/StatesTask.ts index 83914a1..8d2ad74 100644 --- a/app/Tasks/StatesTask.ts +++ b/app/Tasks/StatesTask.ts @@ -1,7 +1,7 @@ import Logger from '@ioc:Adonis/Core/Logger' import { fetchDevelopingState } from 'App/Utils/StatesUtils' -const MS = 1000 * 2 * 60 // 2 min +const MS = 1000 * 2 * 60 // 2 minutes let taskId export async function Activate(): Promise { diff --git a/app/Tasks/StatsTask.ts b/app/Tasks/StatsTask.ts index 4b60dd0..2127eac 100644 --- a/app/Tasks/StatsTask.ts +++ b/app/Tasks/StatsTask.ts @@ -4,7 +4,7 @@ import axios from 'axios' import DevelopmentHour from 'App/Models/DevelopmentHour' import { updateGithubReadmeStats } from 'App/Utils/UpdateGithubReadme' -const MS = 1000 * 5 * 60 // 5 min +const MS = 1000 * 5 * 60 // 5 minutes let taskId interface StatsResponse {