| 
This task will run every 5 minutes, synchronising parent imports with
the status of their children.
When all children have finished, if none of them have failed, the parent
import should get a status of "successful":
    WorkbenchImport status: :successful
      NetexImport status: :successful
      NetexImport status: :successful
When all children have finished, if any of them have failed, the parent
import should get a status of "failed":
    WorkbenchImport status: :failed
      NetexImport status: :failed
      NetexImport status: :successful
We need a Cron job for this instead of being able to do it via a Ruby
method because the thing that's setting the status on the sub-imports
when they're complete is the STIF Java IEV application. Thus there's no
way for our Ruby code to know that a sub-import has finished. Because of
that, we do this polling mechanism every five minutes to update the
imports that need updating.
Created a Rake task to use in the Whenever schedule because the `runner`
method from Whenever expanded to `script/rails`, which is a bloody
ancient file, and tries to run via JRuby lolwat. Didn't want to bother
adding a configuration to Whenever to use something more modern, and
didn't know whether the binstub in `bin/` for `rails` is available since
we don't commit those to the repo apparently (although I knew that fact
from before).
Refs #3511
 |