@@ -6,23 +6,21 @@ import (
6
6
"time"
7
7
8
8
"github.com/nyaruka/gocommon/dates"
9
- "github.com/nyaruka/gocommon/jsonx"
10
9
)
11
10
12
11
// SessionID is our type for RapidPro session ids
13
12
type SessionID int64
14
13
15
14
const sqlInsertTimeoutFire = `
16
15
INSERT INTO contacts_contactfire(org_id, contact_id, fire_type, scope, fire_on, session_uuid, sprint_uuid, extra)
17
- VALUES($1, $2, 'T', '', $3, $4, $5, $6 )
16
+ VALUES($1, $2, 'T', '', $3, $4, $5, '{}' )
18
17
ON CONFLICT DO NOTHING`
19
18
20
19
// insertTimeoutFire inserts a timeout fire for the session associated with the given msg
21
20
func (b * backend ) insertTimeoutFire (ctx context.Context , m * Msg ) error {
22
- extra := map [string ]any {"session_id" : m .SessionID_ , "session_modified_on" : m .SessionModifiedOn_ }
23
21
timeoutOn := dates .Now ().Add (time .Duration (m .Session_ .Timeout ) * time .Second )
24
22
25
- _ , err := b .db .ExecContext (ctx , sqlInsertTimeoutFire , m .OrgID_ , m .ContactID_ , timeoutOn , m .Session_ .UUID , m .Session_ .SprintUUID , jsonx . MustMarshal ( extra ) )
23
+ _ , err := b .db .ExecContext (ctx , sqlInsertTimeoutFire , m .OrgID_ , m .ContactID_ , timeoutOn , m .Session_ .UUID , m .Session_ .SprintUUID )
26
24
if err != nil {
27
25
return fmt .Errorf ("error inserting session timeout contact fire for session #%d: %w" , m .SessionID_ , err )
28
26
}
0 commit comments