Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
0bc8440d
Commit
0bc8440d
authored
Apr 10, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop polling and fetch the table
parent
6c76e81b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
app/assets/javascripts/pipelines/mixins/pipelines.js
app/assets/javascripts/pipelines/mixins/pipelines.js
+8
-5
app/assets/javascripts/pipelines/services/pipelines_service.js
...ssets/javascripts/pipelines/services/pipelines_service.js
+5
-0
No files found.
app/assets/javascripts/pipelines/mixins/pipelines.js
View file @
0bc8440d
...
@@ -65,13 +65,13 @@ export default {
...
@@ -65,13 +65,13 @@ export default {
updateTable
()
{
updateTable
()
{
// Cancel ongoing request
// Cancel ongoing request
if
(
this
.
isMakingRequest
)
{
if
(
this
.
isMakingRequest
)
{
this
.
service
.
cancelationSource
.
cancel
();
}
}
// Stop polling
// Stop polling
this
.
poll
.
stop
();
this
.
poll
.
stop
();
// make new request
// make new request
this
.
fetch
Pipelines
();
this
.
get
Pipelines
();
// restart polling
// restart polling
this
.
poll
.
restart
();
this
.
poll
.
restart
();
},
},
...
@@ -79,10 +79,13 @@ export default {
...
@@ -79,10 +79,13 @@ export default {
if
(
!
this
.
isMakingRequest
)
{
if
(
!
this
.
isMakingRequest
)
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
this
.
getPipelines
();
}
},
getPipelines
()
{
this
.
service
.
getPipelines
(
this
.
requestData
)
this
.
service
.
getPipelines
(
this
.
requestData
)
.
then
(
response
=>
this
.
successCallback
(
response
))
.
then
(
response
=>
this
.
successCallback
(
response
))
.
catch
(()
=>
this
.
errorCallback
());
.
catch
(()
=>
this
.
errorCallback
());
}
},
},
setCommonData
(
pipelines
)
{
setCommonData
(
pipelines
)
{
this
.
store
.
storePipelines
(
pipelines
);
this
.
store
.
storePipelines
(
pipelines
);
...
...
app/assets/javascripts/pipelines/services/pipelines_service.js
View file @
0bc8440d
...
@@ -19,8 +19,13 @@ export default class PipelinesService {
...
@@ -19,8 +19,13 @@ export default class PipelinesService {
getPipelines
(
data
=
{})
{
getPipelines
(
data
=
{})
{
const
{
scope
,
page
}
=
data
;
const
{
scope
,
page
}
=
data
;
const
CancelToken
=
axios
.
CancelToken
;
this
.
cancelationSource
=
CancelToken
.
source
();
return
axios
.
get
(
this
.
endpoint
,
{
return
axios
.
get
(
this
.
endpoint
,
{
params
:
{
scope
,
page
},
params
:
{
scope
,
page
},
cancelToken
:
this
.
cancelationSource
.
token
,
});
});
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment