Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildgrid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
BuildGrid
buildgrid
Commits
3f623744
Commit
3f623744
authored
6 years ago
by
Finn
Browse files
Options
Downloads
Patches
Plain Diff
BotsInterface checks to see if lease is cancelled.
parent
0573a8a8
No related branches found
No related tags found
Loading
Pipeline
#34656870
failed
6 years ago
Stage: test
Stage: post
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
buildgrid/server/bots/instance.py
+5
-0
5 additions, 0 deletions
buildgrid/server/bots/instance.py
buildgrid/server/job.py
+4
-0
4 additions, 0 deletions
buildgrid/server/job.py
buildgrid/server/scheduler.py
+4
-0
4 additions, 0 deletions
buildgrid/server/scheduler.py
with
13 additions
and
0 deletions
buildgrid/server/bots/instance.py
+
5
−
0
View file @
3f623744
...
...
@@ -98,6 +98,11 @@ class BotsInterface:
def
_check_lease_state
(
self
,
lease
):
# Check for cancelled lease
if
self
.
_scheduler
.
get_lease_cancelled
(
lease
.
id
):
return
None
# If not cancelled, update the status
self
.
_scheduler
.
update_job_lease
(
lease
)
lease_state
=
LeaseState
(
lease
.
state
)
...
...
This diff is collapsed.
Click to expand it.
buildgrid/server/job.py
+
4
−
0
View file @
3f623744
...
...
@@ -117,6 +117,10 @@ class Job:
else
:
return
None
@property
def
lease_cancelled
(
self
):
return
self
.
__lease_cancelled
@property
def
n_tries
(
self
):
return
self
.
_n_tries
...
...
This diff is collapsed.
Click to expand it.
buildgrid/server/scheduler.py
+
4
−
0
View file @
3f623744
...
...
@@ -135,6 +135,10 @@ class Scheduler:
"""
Returns the lease associated to job, if any have been emitted yet.
"""
return
self
.
jobs
[
job_name
].
lease
def
get_job_lease_cancelled
(
self
,
job_name
):
"""
Returns true if the lease is cancelled
"""
return
self
.
jobs
[
job_name
].
lease_cancelled
def
get_job_operation
(
self
,
job_name
):
"""
Returns the operation associated to job.
"""
return
self
.
jobs
[
job_name
].
operation
...
...
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