mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-26 15:08:28 +00:00
Use TxStmt
in SQLite pusher table
This commit is contained in:
parent
3c416517b0
commit
3e87096a21
1 changed files with 3 additions and 3 deletions
|
@ -96,7 +96,7 @@ func (s *pushersStatements) InsertPusher(
|
||||||
ctx context.Context, txn *sql.Tx, session_id int64,
|
ctx context.Context, txn *sql.Tx, session_id int64,
|
||||||
pushkey string, pushkeyTS int64, kind api.PusherKind, appid, appdisplayname, devicedisplayname, profiletag, lang, data, localpart string,
|
pushkey string, pushkeyTS int64, kind api.PusherKind, appid, appdisplayname, devicedisplayname, profiletag, lang, data, localpart string,
|
||||||
) error {
|
) error {
|
||||||
_, err := s.insertPusherStmt.ExecContext(ctx, localpart, session_id, pushkey, pushkeyTS, kind, appid, appdisplayname, devicedisplayname, profiletag, lang, data)
|
_, err := sqlutil.TxStmt(txn, s.insertPusherStmt).ExecContext(ctx, localpart, session_id, pushkey, pushkeyTS, kind, appid, appdisplayname, devicedisplayname, profiletag, lang, data)
|
||||||
logrus.Debugf("Created pusher %d", session_id)
|
logrus.Debugf("Created pusher %d", session_id)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -144,13 +144,13 @@ func (s *pushersStatements) SelectPushers(
|
||||||
func (s *pushersStatements) DeletePusher(
|
func (s *pushersStatements) DeletePusher(
|
||||||
ctx context.Context, txn *sql.Tx, appid, pushkey, localpart string,
|
ctx context.Context, txn *sql.Tx, appid, pushkey, localpart string,
|
||||||
) error {
|
) error {
|
||||||
_, err := s.deletePusherStmt.ExecContext(ctx, appid, pushkey, localpart)
|
_, err := sqlutil.TxStmt(txn, s.deletePusherStmt).ExecContext(ctx, appid, pushkey, localpart)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *pushersStatements) DeletePushers(
|
func (s *pushersStatements) DeletePushers(
|
||||||
ctx context.Context, txn *sql.Tx, appid, pushkey string,
|
ctx context.Context, txn *sql.Tx, appid, pushkey string,
|
||||||
) error {
|
) error {
|
||||||
_, err := s.deletePushersByAppIdAndPushKeyStmt.ExecContext(ctx, appid, pushkey)
|
_, err := sqlutil.TxStmt(txn, s.deletePushersByAppIdAndPushKeyStmt).ExecContext(ctx, appid, pushkey)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue