[ARVADOS] updated: 2.1.0-76-g410412b17
Git user
git at public.arvados.org
Sun Nov 1 22:27:20 UTC 2020
Summary of changes:
lib/crunchrun/background.go | 2 +-
sdk/go/arvados/link.go | 2 +-
services/keepproxy/keepproxy.go | 33 +++++++++++++++++++--------------
3 files changed, 21 insertions(+), 16 deletions(-)
via 410412b172c36e3c66a7c2377c5488b94f9f6deb (commit)
from ad92a003eb3c4efdd3f880b5301033b755d6d247 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 410412b172c36e3c66a7c2377c5488b94f9f6deb
Author: Ward Vandewege <ward at curii.com>
Date: Sun Nov 1 17:27:04 2020 -0500
Fix more golint warnings.
No issue #
Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>
diff --git a/lib/crunchrun/background.go b/lib/crunchrun/background.go
index 8cdba72c1..da5361079 100644
--- a/lib/crunchrun/background.go
+++ b/lib/crunchrun/background.go
@@ -162,7 +162,7 @@ func kill(uuid string, signal syscall.Signal, stdout, stderr io.Writer) error {
return nil
}
-// List UUIDs of active crunch-run processes.
+// ListProcesses lists UUIDs of active crunch-run processes.
func ListProcesses(stdout, stderr io.Writer) int {
// filepath.Walk does not follow symlinks, so we must walk
// lockdir+"/." in case lockdir itself is a symlink.
diff --git a/sdk/go/arvados/link.go b/sdk/go/arvados/link.go
index fdddfc537..f7d1f35a3 100644
--- a/sdk/go/arvados/link.go
+++ b/sdk/go/arvados/link.go
@@ -17,7 +17,7 @@ type Link struct {
Properties map[string]interface{} `json:"properties"`
}
-// UserList is an arvados#userList resource.
+// LinkList is an arvados#linkList resource.
type LinkList struct {
Items []Link `json:"items"`
ItemsAvailable int `json:"items_available"`
diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index 94e5c1d27..538a06122 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -173,37 +173,42 @@ type APITokenCache struct {
expireTime int64
}
-// Cache the token and set an expire time. If we already have an expire time
-// on the token, it is not updated.
-func (this *APITokenCache) RememberToken(token string) {
- this.lock.Lock()
- defer this.lock.Unlock()
+// RememberToken caches the token and set an expire time. If we already have
+// an expire time on the token, it is not updated.
+func (cache *APITokenCache) RememberToken(token string) {
+ cache.lock.Lock()
+ defer cache.lock.Unlock()
now := time.Now().Unix()
- if this.tokens[token] == 0 {
- this.tokens[token] = now + this.expireTime
+ if cache.tokens[token] == 0 {
+ cache.tokens[token] = now + cache.expireTime
}
}
-// Check if the cached token is known and still believed to be valid.
-func (this *APITokenCache) RecallToken(token string) bool {
- this.lock.Lock()
- defer this.lock.Unlock()
+// RecallToken checks if the cached token is known and still believed to be
+// valid.
+func (cache *APITokenCache) RecallToken(token string) bool {
+ cache.lock.Lock()
+ defer cache.lock.Unlock()
now := time.Now().Unix()
- if this.tokens[token] == 0 {
+ if cache.tokens[token] == 0 {
// Unknown token
return false
- } else if now < this.tokens[token] {
+ } else if now < cache.tokens[token] {
// Token is known and still valid
return true
} else {
// Token is expired
- this.tokens[token] = 0
+ cache.tokens[token] = 0
return false
}
}
+// GetRemoteAddress returns a string with the remote address for the request.
+// If the X-Forwarded-For header is set and has a non-zero length, it returns a
+// string made from a comma separated list of all the remote addresses,
+// starting with the one(s) from the X-Forwarded-For header.
func GetRemoteAddress(req *http.Request) string {
if xff := req.Header.Get("X-Forwarded-For"); xff != "" {
return xff + "," + req.RemoteAddr
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list