| Fix progress handling - warvox - VoIP based wardialing tool, forked from rapid7… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 8138c352aa5351ef5deab6f89e30f90095f2184b | |
| parent 972a006a04421b6987583fbef7c9c5cf2639a8d1 | |
| Author: HD Moore <[email protected]> | |
| Date: Wed, 2 Jan 2013 03:25:52 -0600 | |
| Fix progress handling | |
| Diffstat: | |
| M app/models/job.rb | 2 +- | |
| M lib/warvox/jobs/analysis.rb | 3 +-- | |
| 2 files changed, 2 insertions(+), 3 deletions(-) | |
| --- | |
| diff --git a/app/models/job.rb b/app/models/job.rb | |
| @@ -45,7 +45,7 @@ class Job < ActiveRecord::Base | |
| belongs_to :project | |
| - attr_accessible :task, :status | |
| + attr_accessible :task, :status, :progress | |
| validates_presence_of :project_id | |
| diff --git a/lib/warvox/jobs/analysis.rb b/lib/warvox/jobs/analysis.rb | |
| @@ -93,7 +93,6 @@ class Analysis < Base | |
| Call.find_each(:conditions => query) do |call| | |
| if @tasks.length < max_threads | |
| - WarVOX::Log.debug("Spawning job for Call #{cal… | |
| @tasks << Thread.new(call.id, job.id) { |c,j| … | |
| else | |
| clear_stale_tasks | |
| @@ -123,7 +122,7 @@ class Analysis < Base | |
| def update_progress(pct) | |
| ::ActiveRecord::Base.connection_pool.with_connection { | |
| - Job.update({ :progress => pct }, { :id => @job_id }) | |
| + Job.update_all({ :progress => pct }, { :id => @job_id … | |
| } | |
| end | |