![]() ![]() Can't activate activesupport (>= 2.2.3, runtime) for. That needs activesupport 2.0.2 But then metric_fu comes along and demands activesupport 2.2.3 or above. In my previous article, I went into great detail about Bundler’s Gemfile and all the magic it contains. The Gemfile, however, is only a part of the Bundler. Activesupport 4.2.5. A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing. DEPRECATION WARNING: Support for Rails ': Use RbConfig instead of obsolete and deprecated Config. /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:314:in `block in replace_gem': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (can't activate mysql2 (~> 0.3.10), already activated mysql2-0.4.3. @Jon, if you need a job to be processed on demand then it sounds like Starling + Workling will be a good solution for you. Another question to ask yourself is how frequently this task will be called. ![]() If you expect it to be only once an hour or less then you may want to try Backgroundjob as that will start/stop the Rails process each time. No need to have something constantly running in the background if you're not using it constantly. @aleco, are you referring to recurring scheduled tasks? This solution was primarily designed for dynamically scheduled tasks where the frequency is not known up front. What you're referring to is definitely possible with one daemon, but the logic can get a little bit tricky in determining what task needs to be run at what given time. You may want to look into BackgrounDRb for this. It has some cron-like scheduling which will work much better for this kind of thing. Regarding the deployment, I honestly haven't tried doing this yet. Ideally you should just add a 'lib/daemons/mailer_ctl restart' call to your deploy.rb restart task. I'm not certain if this works, if not then I think the fault is with the generator and should be fixed. Using 'restart' will do the trick, but if you use the daemon for longer DB tasks, it might be a good idea to stop the daemon before deploying and restarting it afterwards. Because otherwise you might end up migrating a DB you're updating from the daemon at the same moment. This is why I suggested to use:before_update_code and:after_update_code. Oh, another hint: most people will want to add RAILS_DEFAULT_LOGGER.auto_flushing = 1 otherwise they will spend hours trying to find out why their production log isn't updated, assuming their daemon code is buggy. The explanation is that production log uses MAX_BUFFER_SIZE = 1000 and no auto flushing, meaning that it will only write to disk once it has 1000 bytes in buffer. This came at a perfect time for me. I'm now successfully using this method but wanted to comment that I had a horrible time debugging my daemon. It seems the log file spits out a lot of confusing errors. Sample: *** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally *** # *** below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions *** # # # # The confusing part is that, at least for my env, all of those can be ignored. The more confusing part is that I couldn't figure out how to get a backtrace out of my daemon:( So I spent a good chunk of time on the errors shown in the log only to later realize they were red herrings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2018
Categories |