filer: close stores if interrupted

This commit is contained in:
Chris Lu
2020-03-14 20:30:26 -07:00
parent d022b6bc0e
commit 7b37178716
9 changed files with 41 additions and 0 deletions

View File

@@ -25,6 +25,8 @@ type FilerStore interface {
BeginTransaction(ctx context.Context) (context.Context, error)
CommitTransaction(ctx context.Context) error
RollbackTransaction(ctx context.Context) error
Shutdown()
}
type FilerStoreWrapper struct {
@@ -133,3 +135,7 @@ func (fsw *FilerStoreWrapper) CommitTransaction(ctx context.Context) error {
func (fsw *FilerStoreWrapper) RollbackTransaction(ctx context.Context) error {
return fsw.actualStore.RollbackTransaction(ctx)
}
func (fsw *FilerStoreWrapper) Shutdown() {
fsw.actualStore.Shutdown()
}