From 8f6e7188efa1f898b43ba2a1e5733ec1169233ae Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Wed, 27 Mar 2024 11:47:17 +0100 Subject: [PATCH] set default limit for existing account --- cmd/filenode.go | 2 +- index/entry.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/filenode.go b/cmd/filenode.go index 69e5218..7d8ada8 100644 --- a/cmd/filenode.go +++ b/cmd/filenode.go @@ -106,6 +106,7 @@ func main() { func Bootstrap(a *app.App) { a.Register(account.New()). + Register(metric.New()). Register(nodeconfsource.New()). Register(nodeconfstore.New()). Register(nodeconf.New()). @@ -118,7 +119,6 @@ func Bootstrap(a *app.App) { Register(store()). Register(redisprovider.New()). Register(index.New()). - Register(metric.New()). Register(server.New()). Register(filenode.New()). Register(deletelog.New()). diff --git a/index/entry.go b/index/entry.go index 6f73f77..858cbbe 100644 --- a/index/entry.go +++ b/index/entry.go @@ -126,6 +126,10 @@ func (ri *redisIndex) getGroupEntry(ctx context.Context, key Key) (entry *groupE return } groupEntryProto.GroupId = key.GroupId + if groupEntryProto.AccountLimit == 0 { + groupEntryProto.Limit = ri.defaultLimit + groupEntryProto.AccountLimit = ri.defaultLimit + } return &groupEntry{GroupEntry: groupEntryProto}, nil }