[Backgroundrb-devel] Assigning to results - missing something

James Hughes hughes.james at gmail.com
Thu Nov 16 16:49:12 EST 2006


Hi,

I'm trying to convert an app to use 0.2.0, and having a little trouble
understanding how to use the results hash.

Formerly my worker had an instance variable, @file_stats which was
initialized to an empty hash; I have replaced @file_stats with
results[:file_hash]. Actually my initial pass at this was just to do a
s/@file_stats/results[:file_hash]/. Which gets me the following:

        results[:file_stats] = {}
        logger.debug "   Generating checksum for #{path}..."
        results[:file_stats][path][:checksum] =
Digest::MD5.hexdigest(File.read(path))
        logger.debug "   ...done"
        logger.debug "    Getting file size for #{path}..."
        results[:file_stats][path][:size] = File.size(path)
        logger.debug results[:file_stats][path][:size]

So as soon as I attempt the checksum assignment above, bgrb
disappears. I see the 'generating checksum' message, but it never says
'...done'.

Jason Sydes has intimated to me in another thread that I can't do what
I'm attempting above. But a hash is a hash is a hash, right? Or is it?

James

ps. I initially thought this was an issue with the results worker not
starting properly as it doesn't announce it's presence in the log. But
I'm seeing it in the process list, so I assume I can discount that
possibility.


More information about the Backgroundrb-devel mailing list