mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-19 05:23:05 +01:00
Add test for jobs (#34)
This commit is contained in:
@@ -26,11 +26,11 @@ func (b *Bus) PublishRequest(user, f string, ids []driver.DocumentID) error {
|
||||
|
||||
func (b *Bus) SubscribeRequest(f func(msg *RequestMsg)) error {
|
||||
return b.safeSubscribe(b.config.requestKey, ChannelRequest, func(c *emitter.Client, m emitter.Message) {
|
||||
var msg RequestMsg
|
||||
if err := json.Unmarshal(m.Payload(), &msg); err != nil {
|
||||
msg := &RequestMsg{}
|
||||
if err := json.Unmarshal(m.Payload(), msg); err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
go f(&msg)
|
||||
go f(msg)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user