Hi CakePHP,
I have a console task that runs in the background, however it does a lot of database cleaning, and I want to make sure it’s executed only once.
I tried locking the file with flock as described in: https://stackoverflow.com/questions/7018844/how-can-i-ensure-i-have-only-one-instance-of-a-php-script-running-via-apache
however this causing problems with the system.
So is there a way within CakePHP 2.9.1 to lock a task or detect it’s running already and abort, or do I need to write the PID to a file and check manually?
Many thanks.