Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
a1b59254
Commit
a1b59254
authored
7 years ago
by
Chelsea Holland Komlo
Browse files
Options
Download
Email Patches
Plain Diff
code simplifications and logging
parent
e5e4fc4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nomad/resources_endpoint.go
+2
-8
nomad/resources_endpoint.go
with
2 additions
and
8 deletions
+2
-8
nomad/resources_endpoint.go
+
2
-
8
View file @
a1b59254
...
...
@@ -28,7 +28,6 @@ type Resources struct {
// these matches.
func
(
r
*
Resources
)
getMatches
(
iter
memdb
.
ResultIterator
)
([]
string
,
bool
)
{
var
matches
[]
string
isTruncated
:=
false
for
i
:=
0
;
i
<
truncateLimit
;
i
++
{
raw
:=
iter
.
Next
()
...
...
@@ -47,18 +46,14 @@ func (r *Resources) getMatches(iter memdb.ResultIterator) ([]string, bool) {
case
*
structs
.
Node
:
id
=
raw
.
(
*
structs
.
Node
)
.
ID
default
:
r
.
srv
.
logger
.
Printf
(
"[ERR] nomad.resources: unexpected type for resources context
;
%T
\n
"
,
t
)
r
.
srv
.
logger
.
Printf
(
"[ERR] nomad.resources: unexpected type for resources context
:
%T"
,
t
)
continue
}
matches
=
append
(
matches
,
id
)
}
if
iter
.
Next
()
!=
nil
{
isTruncated
=
true
}
return
matches
,
isTruncated
return
matches
,
iter
.
Next
()
!=
nil
}
// getResourceIter takes a context and returns a memdb iterator specific to
...
...
@@ -116,7 +111,6 @@ func (r *Resources) List(args *structs.ResourceListRequest,
// Set the index for the context. If the context has been specified, it
// will be used as the index of the response. Otherwise, the
// maximum index from all resources will be used.
reply
.
Index
=
0
for
_
,
e
:=
range
contexts
{
index
,
err
:=
state
.
Index
(
e
)
if
err
!=
nil
{
...
...
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
Menu
Projects
Groups
Snippets
Help