Quantcast
Channel: Squeezebox : Community : Forums - Logitech Media Server
Viewing all articles
Browse latest Browse all 5300

Is there a way to run a period task in a plugin?

$
0
0
> Like an internal cron for squeezebox? I need to run a task in a plugin
> every day; is there a hook in the plugin API that will let me do this?


You can schedule tasks for later execution using
Slim::Utils::Timers::setTimer(). Once the callback is executed, set a
new timer. Just make sure you don't set more than one. I'm routinely
killing previous timers before setting a new one. Just to make sure I
don't accidentally set multiple timers for the same task.

See eg.
https://github.com/Logitech/slimserv...Plugin.pm#L160

--

Michael

Viewing all articles
Browse latest Browse all 5300

Trending Articles