Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Infinite loop/very long running task

#48

I started out with this - using a clean db:


require 'rubygems'
require 'strokedb'

FileUtils.rm_rf 'test.strokedb' # cleanup the database
StrokeDB::Config.build :default => true, :base_path => 'test.strokedb'
include StrokeDB

Node = Meta.new do
  validates_presence_of :label
  
  # on_initialization do |node|
  #   node.nodes = [] unless node[:nodes]
  # end
  
end

root = Node.named('root', :label => 'root')

# root = Node.named('root')

p Node.find

then I comment-out the db-rebuild steps:


require 'rubygems'
require 'strokedb'

# FileUtils.rm_rf 'test.strokedb' # cleanup the database
StrokeDB::Config.build :default => true, :base_path => 'test.strokedb'
include StrokeDB

Node = Meta.new do
  validates_presence_of :label
  
  # on_initialization do |node|
  #   node.nodes = [] unless node[:nodes]
  # end
  
end

# root = Node.named('root', :label => 'root')

root = Node.named('root')

p Node.find

Everything is still fine. Then I uncomment the on_initialization code block:


require 'rubygems'
require 'strokedb'

# FileUtils.rm_rf 'test.strokedb' # cleanup the database
StrokeDB::Config.build :default => true, :base_path => 'test.strokedb'
include StrokeDB

Node = Meta.new do
  validates_presence_of :label
  
  on_initialization do |node|
    node.nodes = [] unless node[:nodes]
  end
  
end

# root = Node.named('root', :label => 'root')

root = Node.named('root')

p Node.find

This runs very long, probably in an infinite loop (didn't wait for it to finish after 30 secs).

Reported by ronin-14694 (at lighthouseapp) · May 3rd, 2008 @ 03:18 PM

State: new
Milestone: none
Assigned to: Yurii Rashkovskii Yurii Rashkovskii

Activity

  1. Yurii Rashkovskii
    Yurii Rashkovskii

    it seems that this buggy behavior is effective only when doing Node.find(), which uses old index.

    Will investigate more...

    May 3rd, 2008 @ 03:37 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.