~emersion/soju

5ae86d69cc1a76f7b9f85af70caaa6834d1673f2 — sentriz 27 days ago e6d6476
database: use postgresQueryTimeout for PostgresDB StoreMessages

using the sqliteQueryTimeout means a `undefined: sqliteQueryTimeout`
when building with `-tags=nosqlite`
1 files changed, 1 insertions(+), 1 deletions(-)

M database/postgres.go
M database/postgres.go => database/postgres.go +1 -1
@@ 933,7 933,7 @@ func (db *PostgresDB) StoreMessages(ctx context.Context, networkID int64, name s
		return nil, nil
	}

	ctx, cancel := context.WithTimeout(ctx, time.Duration(len(msgs))*sqliteQueryTimeout)
	ctx, cancel := context.WithTimeout(ctx, time.Duration(len(msgs))*postgresQueryTimeout)
	defer cancel()

	tx, err := db.db.BeginTx(ctx, nil)