Skip to content

How does after_success condition work? #220

Answered by gecko984
gecko984 asked this question in Q&A
Discussion options

You must be logged in to vote

I read the docs more thoroughly and upon some reflection came to a solution using task return values, which I'll share here in case other people encounter similar problems. In my model example, the time scale is scaled down with a factor of 60, so basically instead of running the first task every 30 minutes, I run it every 30 seconds (for quicker debug obviously)

import datetime
import random
from time import sleep

from rocketry import Rocketry
from rocketry.args import Return
from rocketry.conds import after_success, time_of_minute


def log(msg):
    print(f'{datetime.datetime.now().isoformat()} | {msg}')


app = Rocketry(execution='thread')


# note that there is no every(...), it is …

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gecko984
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants