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