PERF: Cache Category.subcategory_ids (#9350)

Also reset category cache after backup restore.
This commit is contained in:
Dan Ungureanu
2020-04-09 15:42:24 +03:00
committed by GitHub
parent 1cd8c6ce4c
commit 3d9c320aab
5 changed files with 43 additions and 27 deletions

View File

@ -52,6 +52,7 @@ module BackupRestore
@system.disable_readonly_mode
clear_category_cache
clear_emoji_cache
clear_theme_cache
@ -119,6 +120,12 @@ module BackupRestore
end
end
def clear_category_cache
log "Clearing category cache..."
Category.reset_topic_ids_cache
Category.clear_subcategory_ids
end
def clear_emoji_cache
log "Clearing emoji cache..."
Emoji.clear_cache