[Catalyst] Running Catalyst App from Command Line (or via Cron)

Stuart Watt swatt at infobal.com
Fri Jan 8 16:15:29 GMT 2010


I always liked the solution used by Drupal of simply making cron use 
curl/wget/... to request a special URL. Then it becomes an action and is 
easy to code and configure almost on any platform.

Long-running tasks (beyond that of an HTTP request) are a different 
matter. At present, we do this with our own task manager, which is 
basically nothing to do with Catalyst -- although it shares the code 
under the Catalyst model components. This creates the data needed by the 
app. This can take as long as it likes. We then have a quick switch, 
which updates the config and prods the web server to recycle its worker 
processes.

It probably depends if you are adding data more or less monotonically to 
the current app, or more radically changing it. If it is a radical 
change to the data, I'd guess you'd need to close everything down 
cleanly and restart.

All the best
Stuart


Christoph Friedrich wrote:
> Hello there,
>
> I need to build a script for my catalyst application that reads some 
> data and put it into the database. This script needs to run as a daily 
> cron job.
> My first idea was to create a controller which handles this for me and 
> use some of the other engines for catalyst (like 
> Catalyst::Engine::Embeddable or Catalyst::Engine::JobQueue::POE) but 
> I'm not sure if this is a good way.
> Does someone of you have an idea how to make such a script? Maybe some 
> Best Practices?
>
> Greets
> Christoph
>
> -- 
> This message was scanned by ESVA and is believed to be clean.
> Click here to report this message as spam. 
> http://antispam.infobal.com/cgi-bin/learn-msg.cgi?id=327432806D.62AD5
>
>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>   




More information about the Catalyst mailing list