hirefire 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +61 -14
- data/hirefire.gemspec +2 -11
- data/lib/hirefire.rb +39 -13
- data/lib/hirefire/backend.rb +21 -6
- data/lib/hirefire/backend/delayed_job/active_record.rb +31 -0
- data/lib/hirefire/backend/delayed_job/mongoid.rb +32 -0
- data/lib/hirefire/backend/resque/redis.rb +20 -0
- data/lib/hirefire/environment.rb +65 -12
- data/lib/hirefire/environment/base.rb +112 -10
- data/lib/hirefire/initializer.rb +54 -18
- data/lib/hirefire/railtie.rb +27 -1
- data/lib/hirefire/version.rb +1 -1
- data/lib/hirefire/workers/delayed_job.rb +5 -0
- data/lib/hirefire/{delayed_job_extension.rb → workers/delayed_job/worker.rb} +10 -2
- data/lib/hirefire/workers/resque.rb +31 -0
- data/lib/hirefire/workers/resque/job.rb +70 -0
- data/lib/hirefire/workers/resque/tasks.rb +21 -0
- data/lib/hirefire/workers/resque/worker.rb +57 -0
- data/spec/configuration_spec.rb +20 -0
- data/spec/environment_spec.rb +359 -0
- metadata +36 -9
- data/lib/hirefire/backend/active_record.rb +0 -20
- data/lib/hirefire/backend/mongoid.rb +0 -21
@@ -1,20 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module HireFire
|
4
|
-
module Backend
|
5
|
-
module ActiveRecord
|
6
|
-
|
7
|
-
##
|
8
|
-
# Counts the amount of queued jobs in the database,
|
9
|
-
# failed jobs are excluded from the sum
|
10
|
-
#
|
11
|
-
# @return [Fixnum]
|
12
|
-
def jobs
|
13
|
-
Delayed::Job.
|
14
|
-
where(:failed_at => nil).
|
15
|
-
where('run_at <= ?', Time.now).count
|
16
|
-
end
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module HireFire
|
4
|
-
module Backend
|
5
|
-
module Mongoid
|
6
|
-
|
7
|
-
##
|
8
|
-
# Counts the amount of queued jobs in the database,
|
9
|
-
# failed jobs and jobs scheduled for the future are excluded
|
10
|
-
#
|
11
|
-
# @return [Fixnum]
|
12
|
-
def jobs
|
13
|
-
Delayed::Job.where(
|
14
|
-
:failed_at => nil,
|
15
|
-
:run_at.lte => Time.now
|
16
|
-
).count
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|