Task Services
task create --opencomponent {
function run() {
try{
while( true ) {
print.line( "still running!" ).toConsole()
sleep( 5000 );
}
// Catching this will give us a clean shutdown so the service doesn't show as failed
} catch( java.lang.InterruptedException e ) {
print.line( 'Task interrupted ...' ).toConsole();
} finally {
// Any logic needed to clean up here
}
}Last updated
Was this helpful?