summaryrefslogtreecommitdiffci
path: root/internal/router/client-cache.go
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'internal/router/client-cache.go')
-rw-r--r--internal/router/client-cache.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/router/client-cache.go b/internal/router/client-cache.go
index d607cdd..26557d0 100644
--- a/internal/router/client-cache.go
+++ b/internal/router/client-cache.go
@@ -110,7 +110,11 @@ func (c *ClientCache) Close() error {
return fmt.Errorf("fail to save blog_views: %s", err)
}
- return tx.Commit()
+ if err = tx.Commit(); err != nil {
+ tx.Rollback()
+ return fmt.Errorf("fail to commit all the changes related to cache: %s", err)
+ }
+ return nil
}
func (c *ClientCache) GetHash(id string) string {