mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
PERF: Cache Category.subcategory_ids (#9350)
Also reset category cache after backup restore.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user