fix storage

This commit is contained in:
Philippe PITTOLI 2024-05-23 06:43:38 +02:00
parent d275dc10bd
commit 5a4465ed49

View File

@ -169,7 +169,7 @@ abstract class DODB::Storage(V)
# Creates a new basic index **with a cache**.
# The *name* parameter is the name of the directory that will be created.
def new_index(name : String, &block : Proc(V, String | DODB::NoIndex))
Index::CachedIndex(V).new(self, @directory_name, name, block).tap do |indexer|
Index::BasicCached(V).new(self, @directory_name, name, block).tap do |indexer|
@indexers << indexer
end
end
@ -179,7 +179,7 @@ abstract class DODB::Storage(V)
#
# NOTE: this will be a lot slower than the cached version.
def new_uncached_index(name : String, &block : Proc(V, String | DODB::NoIndex))
Index::Index(V).new(self, @directory_name, name, block).tap do |indexer|
Index::Basic(V).new(self, @directory_name, name, block).tap do |indexer|
@indexers << indexer
end
end