Random changes
This commit is contained in:
parent
6cf22290ad
commit
03826346d9
@ -139,11 +139,11 @@ func (cache *RoomCache) LoadList() error {
|
|||||||
|
|
||||||
func (cache *RoomCache) SaveLoadedRooms() {
|
func (cache *RoomCache) SaveLoadedRooms() {
|
||||||
cache.Lock()
|
cache.Lock()
|
||||||
defer cache.Unlock()
|
|
||||||
cache.clean(false)
|
cache.clean(false)
|
||||||
for node := cache.head; node != nil; node = node.prev {
|
for node := cache.head; node != nil; node = node.prev {
|
||||||
node.Save()
|
node.Save()
|
||||||
}
|
}
|
||||||
|
cache.Unlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cache *RoomCache) SaveList() error {
|
func (cache *RoomCache) SaveList() error {
|
||||||
@ -193,7 +193,7 @@ func (cache *RoomCache) Touch(roomID id.RoomID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cache *RoomCache) TouchNode(node *Room) {
|
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
|
return
|
||||||
}
|
}
|
||||||
cache.Lock()
|
cache.Lock()
|
||||||
|
@ -263,8 +263,10 @@ func cmdRoomNick(cmd *Command) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func cmdHeapProfile(cmd *Command) {
|
func cmdHeapProfile(cmd *Command) {
|
||||||
runtime.GC()
|
if len(cmd.Args) == 0 || cmd.Args[0] != "nogc" {
|
||||||
dbg.FreeOSMemory()
|
runtime.GC()
|
||||||
|
dbg.FreeOSMemory()
|
||||||
|
}
|
||||||
memProfile, err := os.Create("gomuks.heap.prof")
|
memProfile, err := os.Create("gomuks.heap.prof")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
debug.Print("Failed to open gomuks.heap.prof:", err)
|
debug.Print("Failed to open gomuks.heap.prof:", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user