From c737ec82ffe914e20462969c6aee63176d03ba98 Mon Sep 17 00:00:00 2001 From: siddontang Date: Sat, 15 Nov 2014 20:59:40 +0800 Subject: [PATCH] rpl fix panic bug --- rpl/file_store.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpl/file_store.go b/rpl/file_store.go index a8f4940..26a2c5c 100644 --- a/rpl/file_store.go +++ b/rpl/file_store.go @@ -187,7 +187,7 @@ func (s *FileStore) StoreLog(l *Log) error { return s.w.StoreLog(l) } -func (s *FileStore) PuregeExpired(n int64) error { +func (s *FileStore) PurgeExpired(n int64) error { s.rm.Lock() purges := []*tableReader{} @@ -302,6 +302,8 @@ func (s *FileStore) load() error { return err } + s.rs = make(tableReaders, 0, len(fs)) + var r *tableReader var index int64 for _, f := range fs {