[TYPO3-dev] Scheduler task and timeout

Ludwig Rafelsberger ludwig.rafelsberger at gmx.at
Thu Aug 6 19:21:24 CEST 2015


Hi Jérôme,

> So, if I launch a Task from the Scheduler module, TYPO3 will call my
> Task class in CLI mode and no timeout will occure?

Hm, that sentence doesn't sound completely correct to me.

I'll try to elaborate on what exactly one can mean by
> "launch a Task from the Scheduler module"

* if you mean "log into backend using a Browser, select Scheduler
  module and click on the desired tasks play button" then – no. In this
  case you are still:
  - calling the webserver via HTTP
  - which executes some PHP scripts (using PHP module or FPM / CGI)
  - that probably receive a "webserver" PHP configuration
    (which typically and most prominently has max_execution_time set)

* if you mean "have a system shell (cron job, interactive shell, …)
  execute "…/typo3/cli_dispatch.phpsh scheduler" (or a specific task), 
  then you are:
  - calling PHP via command line
  - which executes some PHP scripts
  - while the PHP interpreter probably receives a "cli" PHP
    configuration (which typically incorporates unlimited execution
    time)


Now lets come back to how you formulated it:
> TYPO3 will call my Task class in CLI mode …
not quite. TYPO3 does not "call someones Task class" in that sense,
its more YOU that calls the TYPO3 scheduler php script either using a
BROWSER _or_ the COMMAND LINE. There is no context switch happening
during execution [1]

Beware that - besides execution time limits - there might be more
differences between CLI environment and webserver environment: 
system user, open_basedir restrictions, active modules…



Hope you don't mind the long text - didn't know how to shorten that ;-)


Cheers, 

Ludwig

---
[1] As a side note: AFAIK Flow would actually do that – it starts
subqueries using CLI PHP from the initially called script.



More information about the TYPO3-dev mailing list