Skip to content

[help] How to stop an outdated target from invalidating its downstream target? #1249

Closed Answered by wlandau
Jiefei-Wang asked this question in Help
Discussion options

You must be logged in to vote

To make a target not rerun when its upstream dependencies change, you could supply cue = tar_cue(depend = FALSE) to tar_target().

But in general, file/database connection objects are not exportable. This means they do not easily ship to parallel workers. I would recommend creating each connection within the target itself, i.e.:

run_target <- function() {
  con <- create_connection()
  out <- do_work(con)
  close(con)
  return(out)
}

with:

tar_target(your_target, run_target())

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Jiefei-Wang
Comment options

@wlandau
Comment options

@Jiefei-Wang
Comment options

Answer selected by Jiefei-Wang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants