• Resolved aaron13223

    (@aaron13223)


    Hi There,

    I was wondering if it’s possible for action scheduler to process tasks every 5 seconds or so instead of the normal behaviour of processing the queue every minute.

    I want to process some external API Requests through action scheduler which run as soon as possible after returning a promise. Waiting a minute(at max) is too much in this particular case.

    The WP Cron is run every 5 seconds using a server cron, is something like that possible with Action Scheduler? Or maybe a way to process specific actions to run ASAP?

    Thanks a lot for your time and help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Barry

    (@barryhughes-1)

    Almost anything is possible! πŸ™ƒ

    You’ll probably be interested in the guidance listed over at actionscheduler.org/perf, and you may also wish to use (and adapt as needed) the plugin it links to at the bottom.

    Additionally, if you are able to take advantage of WP CLI, then you can instruct Action Scheduler to create new and custom queues that target specific groups of actions. You can then use your system scheduler (in lots of cases, this will be cron) to trigger your command at whatever interval you require.

    I’m not sure what sort of workloads you are processing, but do be mindful of the dangers of consuming too many system resources, as this may have an adverse affect on the rest of your site.

    Thread Starter aaron13223

    (@aaron13223)

    Hi Barry,

    Thanks a lot for the detailed info!

    I am sorry as I initially missed the WP-CLI part but now that I have read it, this is exactly what I was looking for!

    I was already grouping tasks like this: abc-high, abc-medium, abc-low

    I can now run specific groups of tasks with varying times with the systemd timer on the Server directly.

    Thanks a lot for your help!

    Plugin Contributor Barry

    (@barryhughes-1)

    Excellent, happy to help!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Running Every X sec?’ is closed to new replies.