CodeIgniter Forums
Run controller function after every 30 seconds - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Run controller function after every 30 seconds (/showthread.php?tid=61193)



Run controller function after every 30 seconds - El Forum - 10-13-2014

[eluser]thefatladysingsopera[/eluser]
Hello,is there a way i can call a codeigniter controller after every 30 seconds?.

I can't use cron since its limited up to a minute.

Code:
*/1 * * * * /usr/bin/wget -O /dev/null http://example.com/index.php/cron/longPoll



Run controller function after every 30 seconds - El Forum - 10-13-2014

[eluser]Narf[/eluser]
Code:
* * * * * <first run>; sleep 30; <second run>

You should however reconsider this, chances are it's a bad idea.