diff --git a/app/models/site.rb b/app/models/site.rb index b0edc08b..2b60bdb5 100644 --- a/app/models/site.rb +++ b/app/models/site.rb @@ -223,7 +223,9 @@ class Site < ApplicationRecord # colecciones. def collections unless @read - jekyll.reader.read_collections + Site.one_at_a_time.synchronize do + jekyll.reader.read_collections + end @read = true end @@ -439,6 +441,10 @@ class Site < ApplicationRecord find_by(name: "#{Site.domain}.") end + def self.one_at_a_time + @@one_at_a_time ||= Thread::Mutex.new + end + def reset @read = false @layouts = nil