Schedule Repeating Actions

Every now and then you reach the point where you need some part of your code to be called continuously at a certain interval. May it be every second, 24 hours or two months.

For this, Daeploy contain the call_every decorator that can be used as such

from daeploy import service

def heartbeat():
    # do something every minute

if __name__ == '__main__':

By using this decorator, Daeploy will take care of calling your decorated fuction at the specified interval. Note that the decorated function are not allowed to take any arguments. functools.partial may be used to adhere to this requirement.