Browse Source

style naming the initialization fields for sync command

Xiang Li 12 years ago
parent
commit
fe5fb6cfba
2 changed files with 3 additions and 2 deletions
  1. 3 1
      store/v2/command_factory.go
  2. 0 1
      store/v2/sync_command.go

+ 3 - 1
store/v2/command_factory.go

@@ -73,5 +73,7 @@ func (f *CommandFactory) CreateCompareAndSwapCommand(key string, value string, p
 }
 
 func (f *CommandFactory) CreateSyncCommand(now time.Time) raft.Command {
-	return &SyncCommand{time.Now()}
+	return &SyncCommand{
+		Time: time.Now(),
+	}
 }

+ 0 - 1
store/v2/sync_command.go

@@ -21,7 +21,6 @@ func (c SyncCommand) CommandName() string {
 }
 
 func (c SyncCommand) Apply(server raft.Server) (interface{}, error) {
-
 	s, _ := server.StateMachine().(store.Store)
 	s.DeleteExpiredKeys(c.Time)