Skip to content

Commit

Permalink
Improve download connector registry task (#6390)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpgrailsdev committed May 5, 2023
1 parent 43c18f3 commit 717db41
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions airbyte-config/specs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.util.concurrent.TimeUnit

plugins {
id 'java-library'
}
Expand All @@ -14,11 +16,12 @@ dependencies {

task downloadConnectorRegistry(type: JavaExec, dependsOn: compileJava) {
/**
* run this once a day. if you want to force this task to run do so with --rerun
* e.g. ./gradlew :airbyte-config:specs:downloadConnectorRegistry --info --rerun
* run this once a day or if the file doesn't exist. if you want to force this task to run
* do so with --rerun e.g. ./gradlew :airbyte-config:specs:downloadConnectorRegistry --info --rerun
*/
inputs.property("todaysDate", new Date().clearTime() )
outputs.upToDateWhen { true }
def outputFile = file(rootProject.project(':airbyte-config:init').projectDir.path + '/src/main/resources/seed/oss_registry.json')
outputs.upToDateWhen { outputFile.exists() &&
System.currentTimeMillis() - outputFile.lastModified() < TimeUnit.DAYS.toMillis(1) }
classpath = sourceSets.main.runtimeClasspath
mainClass = 'io.airbyte.config.specs.ConnectorRegistryDownloader'
args project(":airbyte-config:init").projectDir
Expand Down

0 comments on commit 717db41

Please sign in to comment.