style naming the initialization fields for sync command

This commit is contained in:
Xiang Li 2013-11-11 21:21:50 -08:00
parent 8b2e1025ef
commit fe5fb6cfba
2 changed files with 3 additions and 2 deletions

View File

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

View File

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