From 38b6c3afb97ce3baf0ad3baa86ce14442313bbd1 Mon Sep 17 00:00:00 2001 From: Johnny Date: Sun, 15 Jun 2025 10:27:24 +0800 Subject: [PATCH] chore: fix linter --- store/db/mysql/mysql.go | 2 +- store/db/postgres/postgres.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/store/db/mysql/mysql.go b/store/db/mysql/mysql.go index 989d33e89..2862d8722 100644 --- a/store/db/mysql/mysql.go +++ b/store/db/mysql/mysql.go @@ -50,7 +50,7 @@ func (d *DB) Close() error { func (d *DB) IsInitialized(ctx context.Context) (bool, error) { var exists bool - err := d.db.QueryRow("SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE TABLE_NAME = 'memo' AND TABLE_TYPE = 'BASE TABLE')").Scan(&exists) + err := d.db.QueryRowContext(ctx, "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE TABLE_NAME = 'memo' AND TABLE_TYPE = 'BASE TABLE')").Scan(&exists) if err != nil { return false, errors.Wrap(err, "failed to check if database is initialized") } diff --git a/store/db/postgres/postgres.go b/store/db/postgres/postgres.go index 4c8b907b2..4cf017eb7 100644 --- a/store/db/postgres/postgres.go +++ b/store/db/postgres/postgres.go @@ -49,7 +49,7 @@ func (d *DB) Close() error { func (d *DB) IsInitialized(ctx context.Context) (bool, error) { var exists bool - err := d.db.QueryRow("SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'memo' AND table_type = 'BASE TABLE')").Scan(&exists) + err := d.db.QueryRowContext(ctx, "SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = 'memo' AND table_type = 'BASE TABLE')").Scan(&exists) if err != nil { return false, errors.Wrap(err, "failed to check if database is initialized") }