Skip to content

Commit

Permalink
comment out getScenarioState call
Browse files Browse the repository at this point in the history
  • Loading branch information
marianopinto committed Nov 17, 2023
1 parent 25b982a commit ce9ca1a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package pubsub

import (
"context"
"errors"
"fmt"
"log"

"cloud.google.com/go/pubsub"
"github.com/mitchellh/mapstructure"
"go.k6.io/k6/js/modules"
"go.k6.io/k6/lib"
)

// Register the extension on module initialization, available to
Expand Down Expand Up @@ -44,13 +42,13 @@ func (ps *PubSub) Publisher(config map[string]interface{}) *pubsub.Client {
}

func (ps *PubSub) Publish(ctx context.Context, p *pubsub.Client, topic, msg string) error {
state := lib.GetScenarioState(ctx)

if state == nil {
err := errors.New("xk6-pubsub: state is nil")
ReportError(err, "cannot determine state")
return err
}
//state := lib.GetScenarioState(ctx)
//
//if state == nil {
// err := errors.New("xk6-pubsub: state is nil")
// ReportError(err, "cannot determine state")
// return err
//}

t := p.Topic(topic)
r := t.Publish(
Expand Down

0 comments on commit ce9ca1a

Please sign in to comment.