How to use the crontab.prepare_events function in crontab

To help you get started, we’ve selected a few crontab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dashpay / sentinel / test / sentinelTest1.py View on Github external
def do_events():
    # Step 2 - Prepare event
    count = crontab.prepare_events()
    print count, "events successfully prepared (stage 1)"

    # Step 3 - Submit event (try until success)
    print "do_events: Waiting for confirmations"
    initial_bc = get_block_count()
    wait_for_blocks(crontab.CONFIRMATIONS_REQUIRED,initial_bc)
    count = crontab.submit_events()
    while count == 0:
        print "do_events: Waiting some more..."
        wait_for_blocks(1)
        count = crontab.submit_events()

    print count, "events successfully submitted (stage 2)"