Implement sorted entries cache

sorted_entries cached
This commit is contained in:
Leeingnyo
2021-08-22 23:51:23 +09:00
parent 4a09aee177
commit bf81a4e48b
4 changed files with 107 additions and 0 deletions
+5
View File
@@ -187,6 +187,11 @@ class Entry
@book.parents.each do |parent|
InfoCache.invalidate_progress_cache parent.id, username
end
[false, true].each do |ascend|
sorted_entries_cache_key = SortedEntriesCache.gen_key @book.id, username,
@book.entries, SortOptions.new(SortMethod::Progress, ascend)
SortedEntriesCache.invalidate sorted_entries_cache_key
end
TitleInfo.new @book.dir do |info|
if info.progress[username]?.nil?