Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
d78ce179788d
Commit
da0c543e
authored
May 21, 2017
by
Kamil Trzcinski
Committed by
Z.J. van de Weg
May 22, 2017
Browse files
Add MISSING e-tag refresh of resource for Job, and Pipeline Graph
parent
05d696ecef26
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/models/commit_status.rb
View file @
d78ce179
...
...
@@ -89,6 +89,7 @@ class CommitStatus < ActiveRecord::Base
else
PipelineUpdateWorker
.
perform_async
(
pipeline
.
id
)
end
ExpireJobCacheWorker
.
perform_async
(
pipeline
.
id
,
commit_status
.
id
)
end
end
end
...
...
app/workers/expire_job_cache_worker.rb
0 → 100644
View file @
d78ce179
class
ExpireJobCacheWorker
include
Sidekiq
::
Worker
include
BuildQueue
def
perform
(
pipeline_id
,
job_id
)
job
=
CommitStatus
.
joins
(
:pipeline
,
:project
).
find_by
(
id:
job
)
return
unless
job
pipeline
=
job
.
pipeline
project
=
job
.
project
store
.
touch
(
project_pipeline_path
(
project
,
pipeline
))
store
.
touch
(
project_job_path
(
project
,
job
))
end
private
def
project_pipeline_path
(
project
,
pipeline
)
Gitlab
::
Routing
.
url_helpers
.
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
,
format: :json
)
end
def
project_job_path
(
project
,
job
)
Gitlab
::
Routing
.
url_helpers
.
namespace_project_build_path
(
project
.
namespace
,
project
,
job
.
id
,
format: :json
)
end
def
store
@store
||=
Gitlab
::
EtagCaching
::
Store
.
new
end
end
app/workers/expire_pipeline_cache_worker.rb
View file @
d78ce179
...
...
@@ -10,6 +10,7 @@ def perform(pipeline_id)
store
=
Gitlab
::
EtagCaching
::
Store
.
new
store
.
touch
(
project_pipelines_path
(
project
))
store
.
touch
(
project_pipeline_path
(
project
,
pipeline
))
store
.
touch
(
commit_pipelines_path
(
project
,
pipeline
.
commit
))
if
pipeline
.
commit
store
.
touch
(
new_merge_request_pipelines_path
(
project
))
each_pipelines_merge_request_path
(
project
,
pipeline
)
do
|
path
|
...
...
@@ -28,6 +29,14 @@ def project_pipelines_path(project)
format: :json
)
end
def
project_pipeline_path
(
project
,
pipeline
)
Gitlab
::
Routing
.
url_helpers
.
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
,
format: :json
)
end
def
commit_pipelines_path
(
project
,
commit
)
Gitlab
::
Routing
.
url_helpers
.
pipelines_namespace_project_commit_path
(
project
.
namespace
,
...
...
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