Skip to content

Commit

Permalink
fix(horus-events): test time to import new
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Jul 22, 2024
1 parent 188c90c commit 2263bca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion functions/lib/cron-events-horus.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const checkProductsImports = async ({ appSdk, storeId }, horus, opts) => {
storeId,
url: '/items.json',
data: {
size: codigoItems.length + 10 // 10 for products heven't ERP
// size: codigoItems.length + 10 // 10 for products heven't ERP
}
}).then(({ data }) => {
const { hits: { hits } } = data
Expand Down
13 changes: 7 additions & 6 deletions functions/lib/integration/imports/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,20 @@ const getAllItemsHorusToImport = async (horus, storeId, opts) => {
items.forEach((productHorus, index) => {
listItemsToImport.push(productHorus.COD_ITEM)
})
const now = Date.now()
const time = now - init
if (time >= 20000) {
console.log('>> time stop', offset)
hasRepeat = false
}
// const now = Date.now()
// const time = now - init
// if (time >= 20000) {
// console.log('>> time stop', offset)
// hasRepeat = false
// }
} else {
hasRepeat = false
}

offset += limit
}

console.log('>> offset ', offset)
return listItemsToImport
}

Expand Down

0 comments on commit 2263bca

Please sign in to comment.