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
22e00b08
Commit
22e00b08
authored
Sep 18, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make schedule and unschedule consistent
parent
e265fc3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
app/models/ci/build.rb
app/models/ci/build.rb
+5
-5
app/workers/ci/build_schedule_worker.rb
app/workers/ci/build_schedule_worker.rb
+3
-6
No files found.
app/models/ci/build.rb
View file @
22e00b08
...
...
@@ -187,7 +187,7 @@ module Ci
after_transition
any
=>
[
:manual
]
do
|
build
|
build
.
run_after_commit
do
build
.
schedule
build
.
schedule
!
end
end
...
...
@@ -241,17 +241,17 @@ module Ci
end
def
scheduled?
build
.
build_schedule
.
exist?
build
_schedule
.
present?
end
def
schedule
def
schedule
!
return
unless
schedulable?
create_build_schedule!
(
execute_at:
execute_at
)
end
def
unschedule
build
&
.
build_schedule
&
.
delete
def
unschedule
!
build
_schedule
.
delete!
end
def
execute_at
...
...
app/workers/ci/build_schedule_worker.rb
View file @
22e00b08
...
...
@@ -7,13 +7,10 @@ module Ci
def
perform
(
build_id
)
::
Ci
::
Build
.
preload
(
:build_schedule
).
find_by
(
id:
build_id
).
try
do
|
build
|
break
unless
build
.
build_schedule
.
present
?
break
unless
build
.
scheduled
?
begin
Ci
::
PlayBuildService
.
new
(
build
.
project
,
build
.
user
).
execute
(
build
)
ensure
build
.
unschedule
end
build
.
unschedule!
Ci
::
PlayBuildService
.
new
(
build
.
project
,
build
.
user
).
execute
(
build
)
end
end
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