diff options
author | Alex Auvolat <alex@adnab.me> | 2020-03-01 13:08:32 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-03-01 13:08:32 +0100 |
commit | 810e75a34dddd88279bea1cd2ea38816fe872d52 (patch) | |
tree | 780a18b5488dcdac708a4428776e588095442d61 /connector/external | |
parent | 1316a3031b829daa28eda205bd3cdf14b192a0b4 (diff) | |
download | easybridge-810e75a34dddd88279bea1cd2ea38816fe872d52.tar.gz easybridge-810e75a34dddd88279bea1cd2ea38816fe872d52.zip |
Very primitive ability to send fb messages
Diffstat (limited to 'connector/external')
-rw-r--r-- | connector/external/external.go | 7 |
1 files changed, 4 insertions, 3 deletions
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) |