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
Boxiang Sun
gitlab-ce
Commits
94f7595b
Commit
94f7595b
authored
May 17, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define last_pipeline in PipelineScheduleEntity
parent
e9298978
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
app/models/ci/pipeline_schedule.rb
app/models/ci/pipeline_schedule.rb
+0
-4
lib/api/entities.rb
lib/api/entities.rb
+3
-1
No files found.
app/models/ci/pipeline_schedule.rb
View file @
94f7595b
...
...
@@ -44,10 +44,6 @@ module Ci
self
.
next_run_at
=
Gitlab
::
Ci
::
CronParser
.
new
(
cron
,
cron_timezone
).
next_time_from
(
Time
.
now
)
end
def
last_pipeline
self
.
pipelines
&
.
last
end
def
schedule_next_run!
save!
# with set_next_run_at
rescue
ActiveRecord
::
RecordInvalid
...
...
lib/api/entities.rb
View file @
94f7595b
...
...
@@ -690,7 +690,9 @@ module API
expose
:id
expose
:description
,
:ref
,
:cron
,
:cron_timezone
,
:next_run_at
,
:active
expose
:created_at
,
:updated_at
,
:deleted_at
expose
:last_pipeline
,
using:
Entities
::
Pipeline
expose
:last_pipeline
,
using:
Entities
::
Pipeline
do
|
pipeline_schedule
|
pipeline_schedule
.
pipelines
&
.
last
end
expose
:owner
,
using:
Entities
::
UserBasic
end
...
...
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