Live: proxy subscribe data for subscribe and runstream plugin calls (#42824)

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
Alexander Emelin
2021-12-14 20:12:00 +03:00
committed by GitHub
co-authored by Ryan McKinley
parent d2c5dac76f
commit f4cc353225
15 changed files with 62 additions and 45 deletions
+2 -1
View File
@@ -73,6 +73,7 @@ func (r *PluginPathRunner) OnSubscribe(ctx context.Context, user *models.SignedI
resp, err := r.handler.SubscribeStream(ctx, &backend.SubscribeStreamRequest{
PluginContext: pCtx,
Path: r.path,
Data: e.Data,
})
if err != nil {
logger.Error("Plugin OnSubscribe call error", "error", err, "path", r.path)
@@ -82,7 +83,7 @@ func (r *PluginPathRunner) OnSubscribe(ctx context.Context, user *models.SignedI
return models.SubscribeReply{}, resp.Status, nil
}
submitResult, err := r.runStreamManager.SubmitStream(ctx, user, orgchannel.PrependOrgID(user.OrgId, e.Channel), r.path, pCtx, r.handler, false)
submitResult, err := r.runStreamManager.SubmitStream(ctx, user, orgchannel.PrependOrgID(user.OrgId, e.Channel), r.path, e.Data, pCtx, r.handler, false)
if err != nil {
logger.Error("Error submitting stream to manager", "error", err, "path", r.path)
return models.SubscribeReply{}, 0, centrifuge.ErrorInternal