What is a best practice for scheduling a daily function whose time to complete is unknown?

I have a function that gets called on a daily basis through its definition in jobs.config and which is housed in my daily.jsw file.

It performs a series of bulk remove calls on a table, which it does in 500 row “chunks” until all rows that should be removed have been removed.

I am wondering what the time limit is for this to complete. I found this post:

https://www.wix.com/velo/forum/coding-with-velo/what-is-the-maximum-runtime-length-for-job-scheduler-functions

Is the function as I’ve defined it and am having it called via the jobs.config settings considered a “job scheduler function” so that the answer there applies? i.e. minimum timeout is 1 min and max is 6 minutes?

How long should I expect deleting 500 rows from a table to take (for example)?

What this routine is doing is performing clean-up on a series of “pending action” records in a table. These records need to “expire” after 30 days. The number of these records that need to be deleted on a given day is impossible to calculate ahead of time.

Any suggestions about how to design such a clean-up routine, i.e. you don’t know ahead of time how many records need to get deleted but there is a fixed window of time in which the function must execute?