Skip to content

Loading…

fixed first worker spawn on heroku cedar #30

Merged
merged 1 commit into from

2 participants

@lostboy lostboy merged commit 1ff9f77 into lostboy:master

1 check passed

Details default The Travis build passed
@lostboy
Owner

ta. 1.1.1 is up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 12, 2012
  1. spawn workers after_create

    Filip Tepper committed
    fixes #29
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 8 deletions.
  1. +7 −7 lib/workless/scaler.rb
  2. +1 −1 spec/spec_helper.rb
View
14 lib/workless/scaler.rb
@@ -4,19 +4,19 @@
require 'workless/scalers/null'
module Delayed
- module Workless
+ module Workless
module Scaler
-
+
def self.included(base)
base.send :extend, ClassMethods
base.class_eval do
after_destroy "self.class.scaler.down"
- before_create "self.class.scaler.up"
+ after_create "self.class.scaler.up"
after_update "self.class.scaler.down", :unless => Proc.new {|r| r.failed_at.nil? }
end
-
+
end
-
+
module ClassMethods
def scaler
@scaler ||= if ENV.include?("HEROKU_API_KEY")
@@ -30,8 +30,8 @@ def scaler=(scaler)
@scaler = "Delayed::Workless::Scaler::#{scaler.to_s.camelize}".constantize
end
end
-
+
end
-
+
end
end
View
2 spec/spec_helper.rb
@@ -11,7 +11,7 @@ class Delayed::Job::Mock
def self.after_destroy(method, *args)
end
- def self.before_create(method, *args)
+ def self.after_create(method, *args)
end
def self.after_update(method, *args)
Something went wrong with that request. Please try again.