src/flapjack/transport.go in flapjack-2.0.0rc1 vs src/flapjack/transport.go in flapjack-2.0.0
- old
+ new
@@ -32,17 +32,24 @@
}
// Send takes an event and sends it over a transport.
func (t Transport) Send(event Event) (interface{}, error) {
err := event.IsValid()
- if err == nil {
- data, _ := json.Marshal(event)
- reply, err := t.Connection.Do("LPUSH", "events", data)
- if err != nil {
- return nil, err
- }
+ if err != nil {
+ return nil, err
+ }
- return reply, nil
- } else {
+ data, _ := json.Marshal(event)
+ reply, err := t.Connection.Do("LPUSH", "events", data)
+ if err != nil {
return nil, err
}
+
+ // required for Flapjack v2 -- if the broker is split out as a separate
+ // project, this will need to be optional
+ _, err = t.Connection.Do("LPUSH", "events_actions", "+")
+ if err != nil {
+ return nil, err
+ }
+
+ return reply, nil
}