Skip to content
This repository
Browse code

Example tweaks

  • Loading branch information...
commit 22002f13342ee356162a8609adab56a7668ee3e6 1 parent 5463f30
Pratik authored
2  examples/fibers/active_record.ru
@@ -5,7 +5,7 @@ Bundler.setup(:default, :example)
5 5 require 'cramp'
6 6 require 'active_record'
7 7
8   -ActiveRecord::Base.establish_connection(:adapter => "em_mysql2", :username => 'root', :database => "arel_development")
  8 +ActiveRecord::Base.establish_connection(:adapter => "em_mysql2", :username => 'root', :database => "arel_development", :pool => 100)
9 9
10 10 class User < ActiveRecord::Base
11 11 validates_presence_of :name
5 examples/fibers/long_ar_query.ru
@@ -12,7 +12,10 @@ class User < ActiveRecord::Base
12 12 end
13 13
14 14 class LongQueryController < Cramp::Action
15   - use_fiber_pool
  15 + use_fiber_pool do |pool|
  16 + # Called everytime after a fiber is done a callback
  17 + pool.generic_callbacks << proc { ActiveRecord::Base.clear_active_connections! }
  18 + end
16 19
17 20 on_start :run_srsly_long_query
18 21

0 comments on commit 22002f1

Please sign in to comment.
Something went wrong with that request. Please try again.