From 03826346d9bbe44f32e868e18d0367949b518361 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 6 May 2020 23:30:16 +0300 Subject: Random changes --- matrix/rooms/roomcache.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'matrix') diff --git a/matrix/rooms/roomcache.go b/matrix/rooms/roomcache.go index 067cbb6..5af0c5b 100644 --- a/matrix/rooms/roomcache.go +++ b/matrix/rooms/roomcache.go @@ -139,11 +139,11 @@ func (cache *RoomCache) LoadList() error { func (cache *RoomCache) SaveLoadedRooms() { cache.Lock() - defer cache.Unlock() cache.clean(false) for node := cache.head; node != nil; node = node.prev { node.Save() } + cache.Unlock() } func (cache *RoomCache) SaveList() error { @@ -193,7 +193,7 @@ func (cache *RoomCache) Touch(roomID id.RoomID) { } func (cache *RoomCache) TouchNode(node *Room) { - if cache.noUnload || node.touch + 2 > time.Now().Unix() { + if cache.noUnload || node.touch+2 > time.Now().Unix() { return } cache.Lock() -- cgit v1.2.3