Skip to content
Snippets Groups Projects
Commit c4e5b86d authored by Rémi PAILHAREY's avatar Rémi PAILHAREY :fork_knife_plate:
Browse files

Merge branch '17-gaz-quota-429-too-many-request' into 'dev'

Resolve "[Gaz] - Quota 429 Too many request"

See merge request !21
parents 677ab5be f9c3b0b7
Branches
No related tags found
2 merge requests!23Merge Dev into master,!21Resolve "[Gaz] - Quota 429 Too many request"
Pipeline #77617 passed
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
"jest-junit": "^14.0.0", "jest-junit": "^14.0.0",
"standard-version": "^9.5.0", "standard-version": "^9.5.0",
"svgo": "1.3.2", "svgo": "1.3.2",
"webpack": "4.44.2", "webpack": "5.75.0",
"webpack-cli": "3.3.12" "webpack-cli": "5.0.1"
} }
} }
...@@ -58,8 +58,7 @@ async function standaloneStart(token, pce) { ...@@ -58,8 +58,7 @@ async function standaloneStart(token, pce) {
} }
} }
const manualExecution = const manualExecution = process.env.COZY_JOB_MANUAL_EXECUTION === 'true'
process.env.COZY_JOB_MANUAL_EXECUTION === 'true' ? true : false
const startDate = manualExecution const startDate = manualExecution
? moment() ? moment()
.subtract(1, 'year') .subtract(1, 'year')
...@@ -107,12 +106,7 @@ async function start(fields) { ...@@ -107,12 +106,7 @@ async function start(fields) {
) )
fields.access_token = body.attributes.oauth.access_token fields.access_token = body.attributes.oauth.access_token
if ( if (this._account?.oauth_callback_results?.pce && fields.access_token) {
this._account &&
this._account.oauth_callback_results &&
this._account.oauth_callback_results.pce &&
fields.access_token
) {
id_pce = this._account.oauth_callback_results.pce id_pce = this._account.oauth_callback_results.pce
const grdfData = await getData(fields.access_token, id_pce) const grdfData = await getData(fields.access_token, id_pce)
...@@ -168,7 +162,8 @@ async function getData(token, idPCE) { ...@@ -168,7 +162,8 @@ async function getData(token, idPCE) {
}) })
.then(async response => { .then(async response => {
if (response.status !== 200) { if (response.status !== 200) {
throw new Error(response.status + ' - ' + response.statusText) log('error', `Response failed with status ${response.status}`)
throw errors.VENDOR_DOWN
} }
return response.text() return response.text()
}) })
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment