~pounce

Low level programming and open source enthusiast

~pounce/public-inbox

Last active a month ago

~pounce/tokio-walltime

Last active 3 months ago
View more

Recent activity

[PATCH 3/3] contrib: wrap errors correctly 2 months ago

From Calvin Lee to ~emersion/soju-dev

Several error messages in `migrate-logs` are not correctly wrapping the
underlying error, and do not display the underlying error message.

This commit should make debugging a log migration easier, as it wraps
all underlying errors.
---
 contrib/migrate-db/main.go   | 20 ++++++++++----------
 contrib/migrate-logs/main.go | 14 +++++++-------
 msgstore/znclog/reader.go    |  2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/contrib/migrate-db/main.go b/contrib/migrate-db/main.go
index bb45c9d..567ca09 100644
--- a/contrib/migrate-db/main.go
[message trimmed]

[PATCH 2/3] contrib/migrate-db: use explicit src/dest network 2 months ago

From Calvin Lee to ~emersion/soju-dev

This commit makes the source and destination network distinction
explicit. This is necessary, as the source and destination network may
not have the same ID in the database, and thus associations will be broken
when migrated.
---
 contrib/migrate-db/main.go | 37 +++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/contrib/migrate-db/main.go b/contrib/migrate-db/main.go
index 823ca30..bb45c9d 100644
--- a/contrib/migrate-db/main.go
+++ b/contrib/migrate-db/main.go
@@ -71,19 +71,20 @@ func main() {
			log.Fatalf("unable to get source networks for user: #%d %s", user.ID, user.Username)
[message trimmed]

[PATCH 1/3] database: batch msg inserts 2 months ago

From Calvin Lee to ~emersion/soju-dev

This commit takes insert query compilation and transaction creation out
of the critical loop for migrating message logs. I have tested with
the sqlite backend, and a speedup of approximately 40-100x has been
achieved for log migration.

I would appreciate help testing the postgres change.
---
 contrib/migrate-logs/main.go | 14 +++--
 database/database.go         |  1 +
 database/postgres.go         | 93 ++++++++++++++++++++-------------
 database/sqlite.go           | 99 ++++++++++++++++++++++--------------
 4 files changed, 131 insertions(+), 76 deletions(-)

diff --git a/contrib/migrate-logs/main.go b/contrib/migrate-logs/main.go
[message trimmed]