change ids
This commit is contained in:
@@ -7,16 +7,21 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
gob.Register(map[uint64]int64{})
|
||||
}
|
||||
|
||||
type DiskStorage struct {
|
||||
stateFile string
|
||||
lastSave int64
|
||||
LastSaves map[CartId]int64
|
||||
LastSaves map[uint64]int64
|
||||
}
|
||||
|
||||
func NewDiskStorage(stateFile string) (*DiskStorage, error) {
|
||||
ret := &DiskStorage{
|
||||
stateFile: stateFile,
|
||||
LastSaves: make(map[CartId]int64),
|
||||
LastSaves: make(map[uint64]int64),
|
||||
}
|
||||
err := ret.loadState()
|
||||
return ret, err
|
||||
@@ -64,7 +69,7 @@ func (s *DiskStorage) loadState() error {
|
||||
func (s *DiskStorage) Store(id CartId, _ *CartGrain) error {
|
||||
// With the removal of the legacy message log, we only update the timestamp.
|
||||
ts := time.Now().Unix()
|
||||
s.LastSaves[id] = ts
|
||||
s.LastSaves[uint64(id)] = ts
|
||||
s.lastSave = ts
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user