Compare with DB when loading library cache (fixes #256)

This commit is contained in:
Alex Ling
2022-01-24 14:18:52 +00:00
parent 750fbbb8fe
commit 77df418390
3 changed files with 33 additions and 8 deletions
+14
View File
@@ -619,6 +619,20 @@ class Storage
{token, expires}
end
def count_titles : Int32
count = 0
MainFiber.run do
get_db do |db|
db.query "select count(*) from titles" do |rs|
rs.each do
count = rs.read Int32
end
end
end
end
count
end
def close
MainFiber.run do
unless @db.nil?