Skip to content

Instantly share code, notes, and snippets.

@khuyentran1401
Last active June 29, 2022 16:13
Show Gist options
  • Save khuyentran1401/aa85c331c8ee1650bbf5db401c3da703 to your computer and use it in GitHub Desktop.
Save khuyentran1401/aa85c331c8ee1650bbf5db401c3da703 to your computer and use it in GitHub Desktop.
from prefect import task, flow
from prefect.tasks import task_input_hash
...
@task(
cache_key_fn=task_input_hash, # new code
cache_expiration=timedelta(days=1), # new code
)
def get_general_info_of_repos(auth: dict):
...
@task(
cache_key_fn=task_input_hash, # new code
cache_expiration=timedelta(days=1), # new code
)
def get_starred_repo_urls(data: list):
...
@task(
cache_key_fn=task_input_hash, # new code
cache_expiration=timedelta(days=1), # new code
)
def get_specific_info_of_repos(auth: dict, repo_urls: list):
...
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment