Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
2bc2dec4
Commit
2bc2dec4
authored
1 year ago
by
Erwan Rouchet
Committed by
Bastien Abadie
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix a race condition in the process configuration page
parent
15fc66fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1587
Fix a race condition in the process configuration page
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/Process/Configure.vue
+23
-16
23 additions, 16 deletions
src/views/Process/Configure.vue
with
23 additions
and
16 deletions
src/views/Process/Configure.vue
+
23
−
16
View file @
2bc2dec4
...
...
@@ -318,21 +318,8 @@ export default {
workerActivity
:
true
,
useGPU
:
false
}),
async
mounted
()
{
await
this
.
getProcess
()
if
([
'
dataset
'
,
'
workers
'
].
includes
(
this
.
process
?.
mode
))
{
if
(
this
.
hasAdminAccess
)
this
.
listWorkerRuns
({
processId
:
this
.
id
})
}
else
if
(
this
.
process
?.
started
)
{
/*
* This process has started: replace this route with the process status page,
* unless we were coming from the status page or one of the process configuration pages.
*/
if
([
'
process-details
'
,
'
process-filter
'
,
'
process-configure
'
,
'
process-datasets
'
].
includes
(
this
.
$route
.
redirectedFrom
?.
name
))
this
.
$router
.
back
()
else
this
.
$router
.
replace
({
name
:
'
process-details
'
,
params
:
{
id
:
this
.
process
.
id
}
})
}
else
{
this
.
$router
.
replace
({
name
:
'
not-found
'
})
}
mounted
()
{
this
.
getProcess
()
},
computed
:
{
...
mapVuexState
(
'
process
'
,
[
...
...
@@ -349,7 +336,7 @@ export default {
return
this
.
process
?.
corpus
},
hasAdminAccess
()
{
if
(
this
.
process
)
return
this
.
canAdmin
(
this
.
corpus
)
if
(
this
.
process
&&
this
.
corpusId
)
return
this
.
canAdmin
(
this
.
corpus
)
return
true
},
isReadOnly
()
{
...
...
@@ -513,6 +500,26 @@ export default {
}
},
watch
:
{
process
:
{
immediate
:
true
,
async
handler
(
newValue
,
oldValue
)
{
if
(
!
newValue
||
newValue
.
id
===
oldValue
?.
id
)
return
if
([
'
dataset
'
,
'
workers
'
].
includes
(
newValue
.
mode
))
{
// Make sure we have the corpora available before checking for access
await
this
.
$store
.
dispatch
(
'
corpora/list
'
)
if
(
this
.
hasAdminAccess
)
this
.
listWorkerRuns
({
processId
:
newValue
.
id
})
}
else
if
(
newValue
.
started
)
{
/*
* This process has started: replace this route with the process status page,
* unless we were coming from the status page or one of the process configuration pages.
*/
if
([
'
process-details
'
,
'
process-filter
'
,
'
process-configure
'
,
'
process-datasets
'
].
includes
(
this
.
$route
.
redirectedFrom
?.
name
))
this
.
$router
.
back
()
else
this
.
$router
.
replace
({
name
:
'
process-details
'
,
params
:
{
id
:
newValue
.
id
}
})
}
else
{
this
.
$router
.
replace
({
name
:
'
not-found
'
})
}
}
},
currentProcessWorkerRuns
:
{
immediate
:
true
,
handler
(
newRuns
,
oldRuns
=
[])
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment