Browse Source

move constants out for windows

Barak Michener 11 years ago
parent
commit
977c74069c
3 changed files with 18 additions and 2 deletions
  1. 8 0
      etcdmain/const_unix.go
  2. 8 0
      etcdmain/const_windows.go
  3. 2 2
      etcdmain/etcd.go

+ 8 - 0
etcdmain/const_unix.go

@@ -0,0 +1,8 @@
+// +build !windows,!plan9
+
+package etcdmain
+
+const (
+	defaultMaxSnapshots = 5
+	defaultMaxWALs      = 5
+)

+ 8 - 0
etcdmain/const_windows.go

@@ -0,0 +1,8 @@
+// +build windows
+
+package etcdmain
+
+const (
+	defaultMaxSnapshots = 0
+	defaultMaxWALs      = 0
+)

+ 2 - 2
etcdmain/etcd.go

@@ -63,8 +63,8 @@ var (
 	snapCount       = fs.Uint64("snapshot-count", etcdserver.DefaultSnapCount, "Number of committed transactions to trigger a snapshot")
 	printVersion    = fs.Bool("version", false, "Print the version and exit")
 	forceNewCluster = fs.Bool("force-new-cluster", false, "Force to create a new one member cluster")
-	maxSnapFiles    = fs.Uint("max-snapshots", 5, "Maximum number of snapshot files to retain (0 is unlimited)")
-	maxWalFiles     = fs.Uint("max-wals", 5, "Maximum number of wal files to retain (0 is unlimited)")
+	maxSnapFiles    = fs.Uint("max-snapshots", defaultMaxSnapshots, "Maximum number of snapshot files to retain (0 is unlimited)")
+	maxWalFiles     = fs.Uint("max-wals", defaultMaxWALs, "Maximum number of wal files to retain (0 is unlimited)")
 
 	initialCluster      = fs.String("initial-cluster", "default=http://localhost:2380,default=http://localhost:7001", "Initial cluster configuration for bootstrapping")
 	initialClusterToken = fs.String("initial-cluster-token", "etcd-cluster", "Initial cluster token for the etcd cluster during bootstrap")