Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GirlFriday.status error: LocalJumpError: no block given (yield) #37

Closed
fbjork opened this issue Sep 26, 2011 · 5 comments
Closed

GirlFriday.status error: LocalJumpError: no block given (yield) #37

fbjork opened this issue Sep 26, 2011 · 5 comments

Comments

@fbjork
Copy link

fbjork commented Sep 26, 2011

I put this in my girl_friday.rb initializer:

require 'redis'
require 'connection_pool'

$redis = ConnectionPool.new(size: 4) { Redis.connect(url: ENV["REDISTOGO_URL"]) }

SYNC_ACCOUNT_QUEUE = GirlFriday::WorkQueue.new(:sync_account, size: 2, store: GirlFriday::Store::Redis, store_config: { pool: $redis }) do |msg|
Account.sync_account_info(msg[:account_id])
end

When I tried to run GirlFriday.status I get this now:

LocalJumpError: no block given (yield)
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/persistence.rb:56:in block in redis'
from /app/vendor/bundle/ruby/1.9.1/gems/connection_pool-0.1.0/lib/connection_pool.rb:41:inwith'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/persistence.rb:55:in redis'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/persistence.rb:44:insize'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/work_queue.rb:55:in status'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:43:inblock in status'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:41:in each'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:41:ininject'
from /app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:41:in `status'

@ryanlecompte
Copy link
Collaborator

Fredrik, this is a bug in the current release of girl_friday. It has been
fixed in master. Could you try using the current master for now? We will
release a new version of girl_friday at some point in the near future, and
it will contain this bug fix. There was a regression in
GirlFriday::Store::Redis#size after the recent refactor to use
connection_pool (just fixed today in master).

On Mon, Sep 26, 2011 at 6:12 PM, Fredrik Bjrk <
reply@reply.github.com>wrote:

I put this in my girl_friday.rb initializer:

require 'redis'
require 'connection_pool'

$redis = ConnectionPool.new(size: 4) { Redis.connect(url:
ENV["REDISTOGO_URL"]) }

SYNC_ACCOUNT_QUEUE = GirlFriday::WorkQueue.new(:sync_account, size: 2,
store: GirlFriday::Store::Redis, store_config: { pool: $redis }) do |msg|
Account.sync_account_info(msg[:account_id])
end

When I tried to run GirlFriday.status I get this now:

LocalJumpError: no block given (yield)
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/persistence.rb:56:in
block in redis'
from
/app/vendor/bundle/ruby/1.9.1/gems/connection_pool-0.1.0/lib/connection_pool.rb:41:inwith'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/persistence.rb:55:in
redis'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/persistence.rb:44:insize'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday/work_queue.rb:55:in
status'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:43:inblock
in status'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:41:in
each'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:41:ininject'
from
/app/vendor/bundle/ruby/1.9.1/gems/girl_friday-0.9.6/lib/girl_friday.rb:41:in
`status'

Reply to this email directly or view it on GitHub:
#37

@mperham
Copy link
Owner

mperham commented Sep 27, 2011

Ryan, any idea how this bug could have gotten released? I thought we had tests for Redis storage.

@ryanlecompte
Copy link
Collaborator

No clue, it looks like it got in there with @jc00ke's release yesterday. When I was doing my code cleanup branch this morning I noticed that the #size method was broken, and fixed it. I forgot to mention it to you guys this morning when I sent the code review out. I thought we had Redis tests too, but perhaps none that exercised #size.

@mperham
Copy link
Owner

mperham commented Sep 27, 2011

Added exercise for #size

@mperham mperham closed this as completed Sep 27, 2011
@ryanlecompte
Copy link
Collaborator

Great. I think this was a result of the recent refactor to use connection_pool for the Redis storage class (that particular method wasn't using the block-based approach). Thanks for adding the test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants