Skip to content

Commit

Permalink
Stop failing with small package count
Browse files Browse the repository at this point in the history
  • Loading branch information
rkent committed Sep 2, 2024
1 parent e61b681 commit 027af78
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions _ruby_libs/lunr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def precompile_lunr_index(site, index, ref, fields, output_dir, shard_count = 1)
FileUtils.mkdir_p(site.dest) unless File.directory?(site.dest)
FileUtils.mkdir_p(output_dirpath) unless File.directory?(output_dirpath)
shard_size = index.length / shard_count
if shard_size == 0 then shard_size = 1 end

Enumerator.new do |enum|
shards = index.each_slice(shard_size).with_index.collect do |index_slice, i|
Expand Down

0 comments on commit 027af78

Please sign in to comment.