Skip to content
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
4 changes: 3 additions & 1 deletion cmd/mysync/abort.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ var abortCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliAbort())
code := app.CliAbort()
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
12 changes: 9 additions & 3 deletions cmd/mysync/hosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ var hostCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliHostList())
code := app.CliHostList()
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -51,7 +53,9 @@ var hostAddCmd = &cobra.Command{
}
})

os.Exit(app.CliHostAdd(args[0], streamFromVar, priorityVal, dryRun, skipMySQLCheck))
code := app.CliHostAdd(args[0], streamFromVar, priorityVal, dryRun, skipMySQLCheck)
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -65,7 +69,9 @@ var hostRemoveCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliHostRemove(args[0]))
code := app.CliHostRemove(args[0])
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/mysync/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ var infoCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliInfo(short, infoZone, infoLag, infoHost))
code := app.CliInfo(short, infoZone, infoLag, infoHost)
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
12 changes: 9 additions & 3 deletions cmd/mysync/maintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ var maintOnCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliEnableMaintenance(maintWait, maintReason, mode))
code := app.CliEnableMaintenance(maintWait, maintReason, mode)
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -57,7 +59,9 @@ var maintOffCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliDisableMaintenance(maintWait))
code := app.CliDisableMaintenance(maintWait)
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -71,7 +75,9 @@ var maintGetCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliGetMaintenance())
code := app.CliGetMaintenance()
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
16 changes: 12 additions & 4 deletions cmd/mysync/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ var optimizeOnCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliEnableOptimization())
code := app.CliEnableOptimization()
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -40,7 +42,9 @@ var optimizeOffCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliDisableOptimization())
code := app.CliDisableOptimization()
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -53,7 +57,9 @@ var optimizeOffAllCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliDisableAllOptimization())
code := app.CliDisableAllOptimization()
app.CloseLogger()
os.Exit(code)
},
}

Expand All @@ -65,7 +71,9 @@ var optimizeGetCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliGetOptimization())
code := app.CliGetOptimization()
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/mysync/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ var stateCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliState(short))
code := app.CliState(short)
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
4 changes: 3 additions & 1 deletion cmd/mysync/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ var switchCmd = &cobra.Command{
fmt.Println(err)
os.Exit(1)
}
os.Exit(app.CliSwitch(switchFrom, switchTo, switchWait, failover))
code := app.CliSwitch(switchFrom, switchTo, switchWait, failover)
app.CloseLogger()
os.Exit(code)
},
}

Expand Down
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ require (
github.com/google/uuid v1.6.0
github.com/heetch/confita v0.11.0
github.com/jmoiron/sqlx v1.4.0
github.com/rs/zerolog v1.35.1
github.com/shirou/gopsutil/v3 v3.24.5
github.com/spf13/cobra v1.10.2
github.com/spf13/pflag v1.0.10
github.com/stretchr/testify v1.11.1
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
)

require (
filippo.io/edwards25519 v1.2.0 // indirect
github.com/BurntSushi/toml v1.6.0 // indirect
Expand Down
7 changes: 7 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e h1:Q6MvJtQK/iRcRtzAscm/zF23XxJlbECiGPyRicsX+Ak=
github.com/lufia/plan9stats v0.0.0-20260330125221-c963978e514e/go.mod h1:autxFIvghDt3jPTLoqZ9OZ7s9qTGNAWmYCjVFWPX/zg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
Expand All @@ -112,6 +116,8 @@ github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI=
github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
Expand Down Expand Up @@ -181,6 +187,7 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI=
golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
Loading
Loading