[Backgroundrb-devel] BackgrounDRb not working properly with files ?
tim.anglade at gmail.com
Wed Jul 19 11:57:58 EDT 2006
Yup, that did the trick.
Nice one, I obviously wouldn't have been able to catch that by myself...
I'll tune it to load only file_column.
Many, many thanks !
On 7/19/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> On Jul 19, 2006, at 8:43 AM, Tim Anglade wrote:
> > Hey there, thanks for the quick response !
> > On 7/19/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> >> Hey Tim-
> >> The first thing I would think of is that you are not
> >> passing an
> >> absolute path to this worker. Can you verify? What is the exact path
> >> you pass in to kick this worker off? There should not be an issue
> >> with using any of the code you have in a worker, it should work fine.
> >> This line:
> >> > if File.directory?(args)
> >> Makes me think that the rest of your code is just getting skipped
> >> because the directory may not exist? Can you show me the call you use
> >> in rails to kick this off? Also I would put some @logger.debug
> >> statements inside your worker there so you can see which parts of the
> >> code actually get run when you kick it off.
> >> Thanks
> >> -Ezra
> > Thanks for the input, alas the code is not getting skipped, as I can
> > see debugging lines (I've got some 'puts' thrown around), and the new
> > clips and records are being created.
> > Also, there is no error thrown anywhere, and the problem obviously
> > comes from this line:
> > rec = cl.records.new(:path => fl)
> > which obviously does not work as intended _and_ still does not throw
> > an error... At first I thought (logically) that the error was on
> > file_column's side, but at the same time, this line does work as
> > intended in the console, so the origin of the problem does seem to
> > come from BackgrounDRb.
> > Is there any reason why files would not be passed correctly from a
> > worker to file_column ?
> > I'm thinking this is some kind of linking error between the
> > backgroundrb daemon and the rails models. BackgrounDRb might very well
> > think that :path is a standard field and throw fl at him, while if use
> > the same line within Rails, it will trigger file_column functions to
> > assign the field correctly.
> > Thanks again and Cheers,
> > Tim
> Ok maybe there is something else going on. BackgrounDRb by defalt
> even with the load_rails set to true doers not actually load all of
> rails. It just loads the database connection via boot.rb and all your
> model files. So what I think is happening is that the file_column
> plugin is not being loaded : / So lets try this... Open up the script/
> backgroundrb/start script and add the follwoing line right after the
> require boot.rb line:
> require File.dirname(__FILE__) + "/../../config/environment.rb"
> That wilkl make sure all of rails is loaded including your plugins.
> Now you need to realize that this will also make the backgroundrb
> process take up about 22Mb of ram since it is loading all of rails
> now. This isn't too big of a problem its just a tad inefficient. If
> this causes memory problems for you then you might consider writing a
> few lines to require in just the file column plugin instead of all of
> rails. But I think if you do this then you will get your worker to
> function correctly.
More information about the Backgroundrb-devel