Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump golangci/golangci-lint-action from 3 to 4 #82

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading