Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
38ebed5e
Commit
38ebed5e
authored
8 years ago
by
Alex Dadgar
Browse files
Options
Download
Email Patches
Plain Diff
Review fixes
parent
050cdd5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/gc.go
+3
-6
client/gc.go
with
3 additions
and
6 deletions
+3
-6
client/gc.go
+
3
-
6
View file @
38ebed5e
...
...
@@ -127,9 +127,9 @@ func (a *AllocGarbageCollector) keepUsageBelowThreshold() error {
func
(
a
*
AllocGarbageCollector
)
destroyAllocRunner
(
ar
*
AllocRunner
)
{
// Acquire the destroy lock
select
{
case
a
.
destroyCh
<-
struct
{}{}
:
case
<-
a
.
shutdownCh
:
return
case
a
.
destroyCh
<-
struct
{}{}
:
}
ar
.
Destroy
()
...
...
@@ -141,15 +141,12 @@ func (a *AllocGarbageCollector) destroyAllocRunner(ar *AllocRunner) {
a
.
logger
.
Printf
(
"[DEBUG] client: garbage collected %q"
,
ar
.
Alloc
()
.
ID
)
select
{
case
<-
a
.
destroyCh
:
default
:
}
// Release the lock
<-
a
.
destroyCh
}
func
(
a
*
AllocGarbageCollector
)
Stop
()
{
close
(
a
.
shutdownCh
)
close
(
a
.
destroyCh
)
}
// Collect garbage collects a single allocation on a node
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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