I have a method that runs when I call a specific URL on my application. It processes rows in a database queue. The interval is set as lowest interval possible with Cron, ie. 1 minute. This needs dropping to 30 seconds, so I'm wondering how best to achieve this.
I was thinking I could build a loop into my script that runs the code twice, with a sleep of say 30 seconds in between, but I'm wondering if there's a cleaner way than this.
Also, is there a way of running this method from the command line, without the need to call an actual URL?