added a periodic worker which will call a function periodically based on an input duration