diff options
Diffstat (limited to 'connector')
-rw-r--r-- | connector/connector.go | 2 | ||||
-rw-r--r-- | connector/external/external.go | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/connector/connector.go b/connector/connector.go index 210d4ad..48fc9e7 100644 --- a/connector/connector.go +++ b/connector/connector.go @@ -130,7 +130,7 @@ type Event struct { Room RoomID `json:"room"` // Message text or action text - Text string `json:"text` + Text string `json:"text"` // Attached files such as images Attachments []SMediaObject `json:"attachments"` diff --git a/connector/external/external.go b/connector/external/external.go index 26f3c40..741802c 100644 --- a/connector/external/external.go +++ b/connector/external/external.go @@ -162,7 +162,7 @@ func (ext *External) setupProc() error { } func (ext *External) restartLoop(generation int) { - for { + for i := 0; i < 2; i++ { if ext.proc == nil { break } @@ -178,6 +178,7 @@ func (ext *External) restartLoop(generation int) { break } } + log.Warnf("More than 3 attempts (%s); abandonning.", ext.command) } func (m *extMessageWithData) UnmarshalJSON(jj []byte) error { @@ -294,7 +295,7 @@ func (ext *External) cmd(msg extMessage, data interface{}) (*extMessageWithData, } else { return rep, nil } - case <-time.After(5 * time.Second): + case <-time.After(30 * time.Second): return nil, fmt.Errorf("(%s) timeout", msg.MsgType) } } @@ -379,7 +380,7 @@ func (ext *External) Join(room RoomID) error { func (ext *External) Invite(user UserID, room RoomID) error { _, err := ext.cmd(extMessage{ - MsgType: LEAVE, + MsgType: INVITE, User: user, Room: room, }, nil) |