From 05e1a51f0f5b8211fbd20299cab6a26905a0f11c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 17:10:19 +0300 Subject: [PATCH] Bump golangci/golangci-lint-action from 3 to 4 (#82) * Bump golangci/golangci-lint-action from 3 to 4 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v4) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * fix namings --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Aleksandr Shevchuk --- .github/workflows/golangci-lint.yml | 2 +- internal/mysql/node.go | 6 +++--- internal/mysql/queries.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 23b9b31b..27762597 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,6 +19,6 @@ jobs: go-version: 1.21.3 - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest diff --git a/internal/mysql/node.go b/internal/mysql/node.go index 84ae31b1..5edb5e3f 100644 --- a/internal/mysql/node.go +++ b/internal/mysql/node.go @@ -243,11 +243,11 @@ func (n *Node) exec(queryName string, arg map[string]interface{}) error { return n.execWithTimeout(queryName, arg, n.config.DBTimeout) } -func (n *Node) getRunningQueryIds(excludeUsers []string, timeout time.Duration) ([]int, error) { +func (n *Node) getRunningQueryIDs(excludeUsers []string, timeout time.Duration) ([]int, error) { ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - query := DefaultQueries[queryGetProcessIds] + query := DefaultQueries[queryGetProcessIDs] bquery, args, err := sqlx.In(query, excludeUsers) if err != nil { @@ -663,7 +663,7 @@ func (n *Node) SetReadOnlyWithForce(excludeUsers []string, superReadOnly bool) e go func() { for { - ids, err := n.getRunningQueryIds(excludeUsers, time.Second) + ids, err := n.getRunningQueryIDs(excludeUsers, time.Second) if err == nil { for _, id := range ids { _ = n.exec(queryKillQuery, map[string]interface{}{"kill_id": strconv.Itoa(id)}) diff --git a/internal/mysql/queries.go b/internal/mysql/queries.go index f3aaa7c7..4e0288cd 100644 --- a/internal/mysql/queries.go +++ b/internal/mysql/queries.go @@ -30,7 +30,7 @@ const ( queryEnableEvent = "enable_event" querySetLockTimeout = "set_lock_timeout" queryKillQuery = "kill_query" - queryGetProcessIds = "get_process_ids" + queryGetProcessIDs = "get_process_ids" queryEnableOfflineMode = "enable_offline_mode" queryDisableOfflineMode = "disable_offline_mode" queryGetOfflineMode = "get_offline_mode" @@ -97,7 +97,7 @@ var DefaultQueries = map[string]string{ queryEnableEvent: `ALTER DEFINER = :user@:host EVENT :schema.:name ENABLE`, querySetLockTimeout: `SET SESSION lock_wait_timeout = ?`, queryKillQuery: `KILL :kill_id`, - queryGetProcessIds: `SELECT ID FROM information_schema.PROCESSLIST p WHERE USER NOT IN (?) AND COMMAND != 'Killed'`, + queryGetProcessIDs: `SELECT ID FROM information_schema.PROCESSLIST p WHERE USER NOT IN (?) AND COMMAND != 'Killed'`, queryEnableOfflineMode: `SET GLOBAL offline_mode = ON`, queryDisableOfflineMode: `SET GLOBAL offline_mode = OFF`, queryGetOfflineMode: `SELECT @@GLOBAL.offline_mode AS OfflineMode`,