Skip to content

Commit

Permalink
Stop failing with small package count (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkent authored Sep 9, 2024
1 parent d307dbc commit 53f048c
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 53f048c

Please sign in to comment.