fix
This commit is contained in:
parent
fd4ed3187c
commit
2afc55eb5f
|
@ -41,10 +41,9 @@ func NewClient(config Config) (*Client, error) {
|
||||||
|
|
||||||
// publishWithJetStream ...
|
// publishWithJetStream ...
|
||||||
func publishWithJetStream(streamName, subject string, data []byte) (isPublished bool, err error) {
|
func publishWithJetStream(streamName, subject string, data []byte) (isPublished bool, err error) {
|
||||||
var req = RequestBody{Body: data}
|
|
||||||
|
|
||||||
// Publish jet stream
|
// Publish jet stream
|
||||||
if err = client.natsJetStream.Publish(streamName, subject, toBytes(req)); err != nil {
|
if err = client.natsJetStream.Publish(streamName, subject, data); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
9
pull.go
9
pull.go
|
@ -4,11 +4,6 @@ package appier
|
||||||
type Pull struct{}
|
type Pull struct{}
|
||||||
|
|
||||||
// ProductUpsert ...
|
// ProductUpsert ...
|
||||||
func (Pull) ProductUpsert(payload Payload) (bool, error) {
|
func (Pull) ProductUpsert(payload []byte) (bool, error) {
|
||||||
return publishWithJetStream(JetStreamAppierService, SubjectPullProductUpsert, payload.Data)
|
return publishWithJetStream(JetStreamAppierService, SubjectPullProductUpsert, payload)
|
||||||
}
|
|
||||||
|
|
||||||
// PingService ...
|
|
||||||
func (Pull) PingService(payload Payload) (bool, error) {
|
|
||||||
return publishWithJetStream(JetStreamAppierService, SubjectPingPullService, payload.Data)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue