mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmbackup: cosmetic fixes
This commit is contained in:
parent
8b82f9d8b8
commit
2cc288c023
2 changed files with 5 additions and 5 deletions
|
@ -43,7 +43,7 @@ func main() {
|
||||||
cgroup.UpdateGOMAXPROCSToCPUQuota()
|
cgroup.UpdateGOMAXPROCSToCPUQuota()
|
||||||
|
|
||||||
if len(*snapshotCreateURL) > 0 {
|
if len(*snapshotCreateURL) > 0 {
|
||||||
logger.Infof("%s", "Snapshots enabled")
|
logger.Infof("Snapshots enabled")
|
||||||
logger.Infof("Snapshot create url %s", *snapshotCreateURL)
|
logger.Infof("Snapshot create url %s", *snapshotCreateURL)
|
||||||
if len(*snapshotDeleteURL) <= 0 {
|
if len(*snapshotDeleteURL) <= 0 {
|
||||||
err := flag.Set("snapshot.deleteURL", strings.Replace(*snapshotCreateURL, "/create", "/delete", 1))
|
err := flag.Set("snapshot.deleteURL", strings.Replace(*snapshotCreateURL, "/create", "/delete", 1))
|
||||||
|
@ -55,17 +55,17 @@ func main() {
|
||||||
|
|
||||||
name, err := snapshot.Create(*snapshotCreateURL)
|
name, err := snapshot.Create(*snapshotCreateURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatalf("%s", err)
|
logger.Fatalf("cannot create snapshot: %s", err)
|
||||||
}
|
}
|
||||||
err = flag.Set("snapshotName", name)
|
err = flag.Set("snapshotName", name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatalf("Failed to set snapshotName flag: %v", err)
|
logger.Fatalf("cannot set snapshotName flag: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
err := snapshot.Delete(*snapshotDeleteURL, name)
|
err := snapshot.Delete(*snapshotDeleteURL, name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatalf("%s", err)
|
logger.Fatalf("cannot delete snapshot: %s", err)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ type snapshot struct {
|
||||||
// Create creates a snapshot and the provided api endpoint and returns
|
// Create creates a snapshot and the provided api endpoint and returns
|
||||||
// the snapshot name
|
// the snapshot name
|
||||||
func Create(createSnapshotURL string) (string, error) {
|
func Create(createSnapshotURL string) (string, error) {
|
||||||
logger.Infof("%s", "Creating snapshot")
|
logger.Infof("Creating snapshot")
|
||||||
u, err := url.Parse(createSnapshotURL)
|
u, err := url.Parse(createSnapshotURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Reference in a new issue