Skip to content

Commit

Permalink
Fix API call
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Sep 2, 2024
1 parent a7645b8 commit 0231fdb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/api/tempo/tempo.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ module.exports = function TempoModel(logger, redisClient) {

async function getDataLiveOrFromCache() {
const todayStartDate = dayjs().tz('Europe/Paris').startOf('day').format('YYYY-MM-DDTHH:mm:ssZ');
const todayEndDate = dayjs().tz('Europe/Paris').endOf('day').format('YYYY-MM-DDTHH:mm:ssZ');

const tomorrowStartDate = dayjs().tz('Europe/Paris').add(1, 'day').startOf('day').format('YYYY-MM-DDTHH:mm:ssZ');
const tomorrowEndDate = dayjs().tz('Europe/Paris').add(1, 'day').endOf('day').format('YYYY-MM-DDTHH:mm:ssZ');
const tomorrowEndDate = dayjs().tz('Europe/Paris').add(2, 'day').startOf('day').format('YYYY-MM-DDTHH:mm:ssZ');

// Get today data from cache
let todayData = await getDataFromCache(todayStartDate);
Expand All @@ -51,7 +49,7 @@ module.exports = function TempoModel(logger, redisClient) {
{
params: {
start_date: todayStartDate,
end_date: todayEndDate,
end_date: tomorrowStartDate,
},
headers: {
authorization: `Bearer ${accessToken}`,
Expand Down

0 comments on commit 0231fdb

Please sign in to comment.