Skip to content

Commit

Permalink
Add timeout to docs path cache
Browse files Browse the repository at this point in the history
  • Loading branch information
gazayas committed Aug 9, 2023
1 parent c5ed6ea commit 06b31ea
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def docs
# @path = all_paths.map { |path| path + "/docs/#{target}.md" }.detect { |path| File.exist?(path) }

# TODO Trying to just brute force this for now.
@path = Rails.cache.fetch("bullet_train_path") { `bundle show bullet_train`.chomp }
@path = Rails.cache.fetch("bullet_train_path", expires_in: 30.minutes) { `bundle show bullet_train`.chomp }
@path += "/docs/#{target}.md"

render :docs, layout: "docs"
Expand Down

0 comments on commit 06b31ea

Please sign in to comment.