手动结算和更新nft持有者接口改为后台执行
This commit is contained in:
@@ -2,6 +2,7 @@ package admin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/zeromicro/go-zero/core/threading"
|
||||
"nova_task/internal/logic/nft"
|
||||
"nova_task/internal/pkg/errs"
|
||||
|
||||
@@ -15,7 +16,6 @@ type NftHolderUpdateLogic struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
// NFT持有者更新
|
||||
func NewNftHolderUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *NftHolderUpdateLogic {
|
||||
return &NftHolderUpdateLogic{
|
||||
Logger: logx.WithContext(ctx),
|
||||
@@ -25,7 +25,9 @@ func NewNftHolderUpdateLogic(ctx context.Context, svcCtx *svc.ServiceContext) *N
|
||||
}
|
||||
|
||||
func (l *NftHolderUpdateLogic) NftHolderUpdate() error {
|
||||
lg := nft.NewHolderUpdateLogic(l.ctx, l.svcCtx)
|
||||
lg.HolderUpdate()
|
||||
threading.GoSafe(func() {
|
||||
lg := nft.NewHolderUpdateLogic(context.Background(), l.svcCtx)
|
||||
lg.HolderUpdate()
|
||||
})
|
||||
return errs.Success()
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package admin
|
||||
import (
|
||||
"context"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/threading"
|
||||
"nova_task/internal/logic/nft"
|
||||
"nova_task/internal/pkg/errs"
|
||||
"nova_task/internal/svc"
|
||||
@@ -24,7 +25,10 @@ func NewStakeSettleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Stake
|
||||
}
|
||||
|
||||
func (l *StakeSettleLogic) StakeSettle() error {
|
||||
lg := nft.NewStakeSettleLogic(l.ctx, l.svcCtx)
|
||||
lg.StakeSettle()
|
||||
threading.GoSafe(func() {
|
||||
lg := nft.NewStakeSettleLogic(context.Background(), l.svcCtx)
|
||||
lg.StakeSettle()
|
||||
})
|
||||
|
||||
return errs.Success()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user