chore(storage): storage performance issues (#500)

* chore(storage): storage performance issues

1. close storage connection before shutdown the service
2. update windows image

https://github.com/appleboy/gorush/issues/393

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu
2020-04-23 15:39:24 +08:00
committed by GitHub
parent 4e05611577
commit c2136fffc7
16 changed files with 132 additions and 147 deletions

View File

@@ -40,6 +40,11 @@ func (s *Storage) Init() error {
return nil
}
// Close the storage connection
func (s *Storage) Close() error {
return nil
}
// Reset Client storage.
func (s *Storage) Reset() {
atomic.StoreInt64(&s.stat.TotalCount, 0)

View File

@@ -41,4 +41,6 @@ func TestMemoryEngine(t *testing.T) {
memory.Reset()
val = memory.GetTotalCount()
assert.Equal(t, int64(0), val)
assert.NoError(t, memory.Close())
}