Compare commits

..

No commits in common. "351df7426f251a20e000169b0b1dd394314e197f" and "8dfbe289868eca0052d818f6f62f2fffde31f004" have entirely different histories.

2 changed files with 8 additions and 11 deletions

View File

@ -336,7 +336,8 @@ class DODB::DataBase(V) < DODB::Storage(V)
begin begin
::File.delete file_path key ::File.delete file_path key
rescue File::NotFoundError rescue
# FIXME: Only intercept “no such file" errors
end end
remove_indexes key, value remove_indexes key, value

View File

@ -36,10 +36,7 @@ class DODB::Partition(V) < DODB::Indexer(V)
symlink = get_partition_symlink(partition, key) symlink = get_partition_symlink(partition, key)
begin
::File.delete symlink ::File.delete symlink
rescue File::NotFoundError
end
end end
def get(partition) : Array(V) def get(partition) : Array(V)
@ -131,11 +128,11 @@ class DODB::CachedPartition(V) < DODB::Partition(V)
end end
def get(partition) def get(partition)
r_value = Array(Tuple(V, Int32)).new r_value = Array(V).new
if keys = @data[partition]? if keys = @data[partition]?
keys.each do |data_key| keys.each do |data_key|
r_value << { @storage[data_key], data_key } r_value << @storage[data_key]
end end
else else
# Get the key from the database representation on the file-system. # Get the key from the database representation on the file-system.
@ -143,11 +140,10 @@ class DODB::CachedPartition(V) < DODB::Partition(V)
raise MissingEntry.new(@name, partition) unless Dir.exists? partition_directory raise MissingEntry.new(@name, partition) unless Dir.exists? partition_directory
Dir.each_child partition_directory do |child| Dir.each_child partition_directory do |child|
r_value << { @storage[get_key child], get_key child } r_value << @storage[get_key child]
end end
@data[partition] = r_value
@data[partition] = r_value.map &.[1]
end end
r_value.map &.[0] r_value
end end
end end