Skip to content

Commit

Permalink
fix: sort imports
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Dec 5, 2023
1 parent 10379ef commit 13c3220
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/gfspvgmgr/virtual_group_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"time"

"cosmossdk.io/math"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/bnb-chain/greenfield-storage-provider/base/gfspclient"
"github.com/bnb-chain/greenfield-storage-provider/base/types/gfsperrors"
"github.com/bnb-chain/greenfield-storage-provider/core/consensus"
Expand All @@ -20,7 +22,6 @@ import (
"github.com/bnb-chain/greenfield-storage-provider/util"
sptypes "github.com/bnb-chain/greenfield/x/sp/types"
virtualgrouptypes "github.com/bnb-chain/greenfield/x/virtualgroup/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)

var _ vgmgr.VirtualGroupManager = &virtualGroupManager{}
Expand Down Expand Up @@ -555,14 +556,15 @@ func (vgm *virtualGroupManager) monitorGVGUsage(gvg *virtualgrouptypes.GlobalVir

curTime := time.Now().Unix()
if isEmpty(gvg) {
// if the GVG is refilled, it can be removed from the gcMap.
// Remove any GVG from the gvgGCMap if the stored size is no longer empty.
vgm.gvgGCMap.Range(func(k, v interface{}) bool {
safeDeleteTime := v.(int64)
if curTime > safeDeleteTime+int64(time.Minute.Seconds()) {
vgm.gvgGCMap.Delete(k)
}
return true
})

if !byChain {
gvg, err = vgm.chainClient.QueryGlobalVirtualGroup(context.Background(), gvg.Id)
if err != nil {
Expand Down

0 comments on commit 13c3220

Please sign in to comment.