Commit 54f9c489 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Fixed some state saving issue that occured when data expired

parent c773edc6
Pipeline #3804 failed with stages
in 1 minute and 10 seconds
......@@ -8,12 +8,17 @@ export default class {
* @param callback: An arbitrary callback with one argument (the state ID).
*/
chart2id (vm, callback) {
if (vm._setStateChangedCallback === 'undefined') {
if (typeof vm._setStateChangedCallback === 'undefined') {
throw new Error('Cannot generate an id for this chart. It does not permit state saving.')
}
vm._setStateChangedCallback(async function (name, state) {
const rv = await store.getters.requestManager.saveState({chartName: name, chartState: state})
const stateID = rv.data.state_id
let stateID = ''
try {
const rv = await store.getters.requestManager.saveState({chartName: name, chartState: state})
stateID = rv.data.state_id
} catch (e) {
console.error(e.response.data.error)
}
callback(stateID)
})
}
......@@ -30,7 +35,7 @@ export default class {
await store.getters.requestManager.requestStateAccess(stateID)
let timeWaited = 0
let delay = 200
while (timeWaited <= 900000) { // we wait 15 minutes
while (timeWaited <= 900000) { // we wait 15 minutes
await timeout(delay)
timeWaited += delay
delay += 100
......
......@@ -64,8 +64,13 @@
['SUBMITTED', 'SUCCESS', 'FAILURE'].includes(item.etl_state)
})
},
existing_ids () {
return this.items.map(item => item.task_id)
},
transformedIDs () {
return this.checkedIds.map(id => `$${JSON.stringify({id, filters: { feature: this.featureFilter[id] }})}$`)
return this.checkedIds
.filter(id => this.existing_ids.includes(id))
.map(id => `$${JSON.stringify({id, filters: { feature: this.featureFilter[id] }})}$`)
}
},
watch: {
......
Markdown is supported
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