1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-14 16:26:23 -07:00

Fix error log being written to even if there were no errors

This commit is contained in:
Eggbertx 2024-05-29 12:13:20 -07:00
parent 4613bea216
commit f72435ec8d
2 changed files with 9 additions and 4 deletions

View file

@ -1,6 +1,7 @@
package gcsql
import (
"context"
"database/sql"
"errors"
"fmt"
@ -354,7 +355,10 @@ func (p *Post) Insert(bumpThread bool, boardID int, locked bool, stickied bool,
VALUES(?,?,PARAM_ATON,CURRENT_TIMESTAMP,?,?,?,?,?,?,?,?,?,?)`
bumpSQL := `UPDATE DBPREFIXthreads SET last_bump = CURRENT_TIMESTAMP WHERE id = ?`
tx, err := BeginTx()
ctx, cancel := context.WithTimeout(context.Background(), gcdb.defaultTimeout)
defer cancel()
tx, err := BeginContextTx(ctx)
if err != nil {
return err
}