fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fusenapi/constants"
|
||||
"fusenapi/utils/websocket_data"
|
||||
@@ -11,7 +12,7 @@ import (
|
||||
type MqConsumerRenderResult struct {
|
||||
}
|
||||
|
||||
func (m *MqConsumerRenderResult) Run(data []byte) error {
|
||||
func (m *MqConsumerRenderResult) Run(ctx context.Context, data []byte) error {
|
||||
logx.Info("接收到MqConsumerRenderResult数据:", string(data))
|
||||
var parseInfo websocket_data.RenderImageNotify
|
||||
if err := json.Unmarshal(data, &parseInfo); err != nil {
|
||||
|
||||
@@ -30,6 +30,7 @@ func (w *wsConnectItem) renderImage(data []byte) {
|
||||
return
|
||||
}
|
||||
logx.Info("收到请求云渲染图片数据:", renderImageData)
|
||||
renderImageData.RenderData.UserId = w.userId
|
||||
//把需要渲染的图片任务加进去
|
||||
taskId := hash.JsonHashKey(renderImageData.RenderData)
|
||||
w.renderProperty.renderImageTaskCtlChan <- renderImageControlChanItem{
|
||||
@@ -39,7 +40,7 @@ func (w *wsConnectItem) renderImage(data []byte) {
|
||||
}
|
||||
tmpData := websocket_data.AssembleRenderData{
|
||||
TaskId: taskId,
|
||||
UserId: w.userId,
|
||||
RenderId: renderImageData.RenderId,
|
||||
RenderData: renderImageData.RenderData,
|
||||
}
|
||||
d, _ := json.Marshal(tmpData)
|
||||
|
||||
@@ -33,6 +33,7 @@ func main() {
|
||||
//消费渲染结果队列
|
||||
ctx1 := context.Background()
|
||||
ctx2, cancel := context.WithCancel(ctx1)
|
||||
ctx2 = context.WithValue(ctx2, "allmodels", ctx.AllModels)
|
||||
defer cancel()
|
||||
go ctx.RabbitMq.Consume(ctx2, constants.RABBIT_MQ_RENDER_RESULT_DATA, &logic.MqConsumerRenderResult{})
|
||||
handler.RegisterHandlers(server, ctx)
|
||||
|
||||
Reference in New Issue
Block a user