Skip to content
Snippets Groups Projects
Commit 7e279bb4 authored by git-directory-deploy's avatar git-directory-deploy
Browse files

feat: get history for load data

parent d949ac5d
No related branches found
No related tags found
1 merge request!1Dev
......@@ -134,12 +134,13 @@ async function getDailyData(token, usagePointID) {
* If yes only call once the api
*/
async function startLoadDataProcess(token, usagePointID) {
const isHistory = await isHistoryLoaded('com.grandlyon.enedis.hour')
log('info', 'Check history')
const isHistory = await isHistoryLoaded('com.grandlyon.enedis.minute')
if (isHistory) {
log('info', 'launc process without history')
log('info', 'launch process without history')
await launchLoadDataProcess(token, usagePointID, startLoadDate, endDate)
} else {
log('info', 'launc process with history')
log('info', 'launch process with history')
for (var i = 1; i < 5; i++) {
await launchLoadDataProcess(
token,
......@@ -409,9 +410,11 @@ async function isHistoryLoaded(doctype) {
})
if (filtered.length > 0) {
return false
} else {
return true
}
}
return true
return false
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment