~emersion/soju-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH] database: use postgresQueryTimeout for PostgresDB StoreMessages

Details
Message ID
<20231106141408.65338-1-senan@senan.xyz>
DKIM signature
missing
Download raw message
Patch: +1 -1
using the sqliteQueryTimeout means a `undefined: sqliteQueryTimeout`
when building with `-tags=nosqlite`

---
 database/postgres.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/database/postgres.go b/database/postgres.go
index 68672a6..ca6bf51 100644
--- a/database/postgres.go
+++ b/database/postgres.go
@@ -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)
-- 
2.42.0
Details
Message ID
<858c34d1-126b-4ddb-80d4-b8ccf0393c0f@app.fastmail.com>
In-Reply-To
<20231106141408.65338-1-senan@senan.xyz> (view parent)
DKIM signature
missing
Download raw message
there seems to be no functional difference anyway, since we have 

    const postgresQueryTimeout = 5 * time.Second
    const sqliteQueryTimeout = 5 * time.Second
Details
Message ID
<DlBNtauwZvWW2n0kzqEJ7VKHx7-0Advbv8VXZ9IJVV0g-u6eEhqqXB0NHZlU3HWZ4bUrfu-hSp7X7B4XGKP-HK9DwTL04NCwVFNW953jLbU=@emersion.fr>
In-Reply-To
<20231106141408.65338-1-senan@senan.xyz> (view parent)
DKIM signature
missing
Download raw message
Pushed, thanks for the fix!
Reply to thread Export thread (mbox)