Commit 4aea0a6e authored by Yoan VALLET's avatar Yoan VALLET
Browse files

fix error on cleanOldData

parent 7c83c929
......@@ -147,19 +147,19 @@ async function cleanOldData() {
}
log("debug", "NB OF DELETED OLD DAY DATA : " + result.length)
}
const documents = await cozyClient.data.findAll('com.grandlyon.grdf.month')
if (documents && documents.length > 0) {
const documentsMonth = await cozyClient.data.findAll('com.grandlyon.grdf.month')
if (documentsMonth && documentsMonth.length > 0) {
const result = []
for (const doc of documents) {
for (const doc of documentsMonth) {
const deleteResult = await cozyClient.data.delete('com.grandlyon.grdf.month', doc)
result.push(deleteResult)
}
log("debug", "NB OF DELETED OLD MONTH DATA : " + result.length)
}
const documents = await cozyClient.data.findAll('com.grandlyon.grdf.year')
if (documents && documents.length > 0) {
const documentsYear = await cozyClient.data.findAll('com.grandlyon.grdf.year')
if (documentsYear && documentsYear.length > 0) {
const result = []
for (const doc of documents) {
for (const doc of documentsYear) {
await cozyClient.data.delete('com.grandlyon.grdf.year', doc)
result.push(deleteResult)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment