Skip to content

Commit

Permalink
Bump golangci/golangci-lint-action from 3 to 4 (#82)
Browse files Browse the repository at this point in the history
* 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](golangci/golangci-lint-action@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] <[email protected]>

* fix namings

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aleksandr Shevchuk <[email protected]>
  • Loading branch information
dependabot[bot] and Aleksandr Shevchuk authored Feb 12, 2024
1 parent cccabc9 commit 05e1a51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions internal/mysql/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)})
Expand Down
4 changes: 2 additions & 2 deletions internal/mysql/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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`,
Expand Down

0 comments on commit 05e1a51

Please sign in to comment.