I’m currently using
deadman to effectively cron a UDF to execute every 1 minute:
stream |from() .measurement('does_not_exist') |deadman(1.0, 1m) @doSomething()
Is there a better or more idiomatic way to accomplish this? There’s no data source that this UDF should be triggered by; it’s purely a recurring task. There are other ways I could make this run, of course, but I’d like to continue to follow the Kapacitor/TICKscript/UDF pattern of the overall application. My initial attempt that didn’t work was to run a batch query every 1 minute:
batch |query('''SELECT * FROM "database"."retention_policy"."measurement" LIMIT 1''') .every(1m) @doSomething()
That reads better to me, but didn’t seem to ever execute the UDF.
Any better ideas?