small memory fixes
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
a07ad2387e
commit
51517885ff
19
.github/renovate.json
vendored
19
.github/renovate.json
vendored
@ -1,19 +0,0 @@
|
||||
{
|
||||
"extends": [
|
||||
"config:base"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
||||
"automerge": true
|
||||
},
|
||||
{
|
||||
"groupName": "all deps",
|
||||
"separateMajorMinor": true,
|
||||
"groupSlug": "all",
|
||||
"packagePatterns": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
13
.github/stale.sh
vendored
13
.github/stale.sh
vendored
@ -1,13 +0,0 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
export PATH=$PATH:$(pwd)/bin
|
||||
export GO111MODULE=on
|
||||
export GOBIN=$(pwd)/bin
|
||||
|
||||
#go get github.com/rvflash/goup@v0.4.1
|
||||
|
||||
#goup -v ./...
|
||||
#go get github.com/psampaz/go-mod-outdated@v0.6.0
|
||||
go list -u -m -mod=mod -json all | go-mod-outdated -update -direct -ci || true
|
||||
|
||||
#go list -u -m -json all | go-mod-outdated -update
|
@ -20,11 +20,11 @@ var (
|
||||
// rtr implements router interface
|
||||
type rtr struct {
|
||||
sync.RWMutex
|
||||
running bool
|
||||
table *table
|
||||
opts router.Options
|
||||
exit chan bool
|
||||
initChan chan bool
|
||||
opts router.Options
|
||||
running bool
|
||||
}
|
||||
|
||||
// NewRouter creates new router and returns it
|
||||
|
8
table.go
8
table.go
@ -22,8 +22,8 @@ type table struct {
|
||||
}
|
||||
|
||||
type route struct {
|
||||
route router.Route
|
||||
updated time.Time
|
||||
route router.Route
|
||||
}
|
||||
|
||||
// newtable creates a new routing table and returns it
|
||||
@ -129,7 +129,7 @@ func (t *table) Create(r router.Route) error {
|
||||
}
|
||||
|
||||
// create the route
|
||||
t.routes[service][sum] = &route{r, time.Now()}
|
||||
t.routes[service][sum] = &route{updated: time.Now(), route: r}
|
||||
|
||||
if t.opts.Logger.V(logger.DebugLevel) {
|
||||
t.opts.Logger.Debugf(t.opts.Context, "Router emitting %s for route: %s", router.Create, r.Address)
|
||||
@ -188,7 +188,7 @@ func (t *table) Update(r router.Route) error {
|
||||
|
||||
if _, ok := t.routes[service][sum]; !ok {
|
||||
// update the route
|
||||
t.routes[service][sum] = &route{r, time.Now()}
|
||||
t.routes[service][sum] = &route{updated: time.Now(), route: r}
|
||||
|
||||
if t.opts.Logger.V(logger.DebugLevel) {
|
||||
t.opts.Logger.Debugf(t.opts.Context, "Router emitting %s for route: %s", router.Update, r.Address)
|
||||
@ -198,7 +198,7 @@ func (t *table) Update(r router.Route) error {
|
||||
}
|
||||
|
||||
// just update the route, but dont emit Update event
|
||||
t.routes[service][sum] = &route{r, time.Now()}
|
||||
t.routes[service][sum] = &route{updated: time.Now(), route: r}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -9,10 +9,10 @@ import (
|
||||
// tableWatcher implements routing table Watcher
|
||||
type tableWatcher struct {
|
||||
sync.RWMutex
|
||||
id string
|
||||
opts router.WatchOptions
|
||||
resChan chan *router.Event
|
||||
done chan struct{}
|
||||
id string
|
||||
opts router.WatchOptions
|
||||
}
|
||||
|
||||
// Next returns the next noticed action taken on table
|
||||
|
Loading…
Reference in New Issue
Block a user