Hi,

Im trying to access my database in scheduler action.but its raising
and exception like:



Ping statistics for 64.106.79.110:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
trigger() caught exception
A copy of DeviceController has been removed from the module tree but
is still ac
tive!
C:/Rails1/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dep
endencies.rb:237:in `load_missing_constant'
C:/Rails1/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
active_support/dep
endencies.rb:468:in `const_missing'

My code is as follows in device controller:
[code]
class DeviceController < ApplicationController
 require 'logger'
 require 'openwfe/util/scheduler'
 include OpenWFE

 def index
   scheduler = Scheduler.new
   scheduler.start

# Simple usage
   scheduler.schedule_every('10s') {method1}
   logger.error "here"
   def method1
     @ipadd=Ipaddr.find(:all)
     @ipadd.each do |i|
       logger.error "variable is equal to: #{i.address}"

       if system("ping  #{i.address}")
         logger.error "here2"

         Health.new(:state=>"green",:dev_id=>'1')

       else
         logger.error "here3"
         Health.new(state=>"red",:dev_id=>'2')
         logger.error "here4"

       end
      end

scheduler.join
end
end

[/code]

Its not able to access Health model and create any new row in it!

Can anyone suggest me something wats wrong here??

Thanking in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/openwferu-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to