Merge pull request #54 from unistack-org/memory_fixes

small memory fixes
This commit is contained in:
Василий Толстов 2022-03-27 01:19:47 +03:00 committed by GitHub
commit 70dc513e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 40 deletions

19
.github/renovate.json vendored
View File

@ -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
View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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