Skip to content

Commit

Permalink
fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
alpaca-tc committed Jun 20, 2024
1 parent ab74401 commit dd3157c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/diver_down/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,24 @@ def call(env)

def load_definition_files_on_thread(definition_files)
definition_loader = DiverDown::Web::DefinitionLoader.new
store = self.class.store

Thread.new do
loop do
break if definition_files.empty?

# If store is changed in test, stop loading.
break if store != self.class.store

definition_file = definition_files.shift
definition = definition_loader.load_file(definition_file)

# No needed to synchronize because this is executed on a single thread.
self.class.store.set(definition)
store.set(definition)
end

# Cache combined_definition
self.class.store.combined_definition
store.combined_definition
end
end
end
Expand Down

0 comments on commit dd3157c

Please sign in to comment.