mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:23:25 +08:00
FIX: Restoring backup could fail due to missing uploads
Clearing theme and emoji cache might require uploaded files.
This commit is contained in:
parent
4d719725c8
commit
4f5ea4fbde
|
@ -56,13 +56,14 @@ module BackupRestore
|
|||
@system.disable_readonly_mode
|
||||
|
||||
clear_category_cache
|
||||
clear_emoji_cache
|
||||
clear_theme_cache
|
||||
clear_stats
|
||||
reload_translations
|
||||
|
||||
@uploads_restorer.restore(@tmp_directory)
|
||||
|
||||
clear_emoji_cache
|
||||
clear_theme_cache
|
||||
|
||||
after_restore_hook
|
||||
rescue Compression::Strategy::ExtractFailed
|
||||
log 'ERROR: The uncompressed file is too big. Consider increasing the hidden ' \
|
||||
|
@ -134,6 +135,8 @@ module BackupRestore
|
|||
def clear_emoji_cache
|
||||
log "Clearing emoji cache..."
|
||||
Emoji.clear_cache
|
||||
rescue => ex
|
||||
log "Something went wrong while clearing emoji cache.", ex
|
||||
end
|
||||
|
||||
def reload_translations
|
||||
|
@ -172,6 +175,8 @@ module BackupRestore
|
|||
ThemeField.force_recompilation!
|
||||
Theme.expire_site_cache!
|
||||
Stylesheet::Manager.cache.clear
|
||||
rescue => ex
|
||||
log "Something went wrong while clearing theme cache.", ex
|
||||
end
|
||||
|
||||
def clear_stats
|
||||
|
|
Loading…
Reference in New Issue
Block a user