Skip to content

Commit

Permalink
Revert "Skip if updated within last two minutes"
Browse files Browse the repository at this point in the history
This reverts commit 32b92b5.
  • Loading branch information
cvennel committed Jun 2, 2020
1 parent 0542156 commit 3d4a44d
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions config/groovy/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,6 @@ class common {
println color("uncommitted changes. Skipping.", Ansi.YELLOW)
} else {
println color("updating $itemType $itemName", Ansi.GREEN)
File targetDirFetchHead = new File("$targetDir/.git/FETCH_HEAD")
Date lastUpdate = new Date(targetDirFetchHead.lastModified())
def recentlyUpdated = use(groovy.time.TimeCategory){
def timeElapsedSinceUpdate = new Date() - lastUpdate
if (timeElapsedSinceUpdate < 2.minutes){
println color("Skipping update for $itemName: updated within last 2 minutes", Ansi.YELLOW)
return true
} else {
return false
}
}
if (recentlyUpdated){
return
}
try {
def current_sha = itemGit.log(maxCommits: 1).find().getAbbreviatedId(8)
itemGit.pull remote: defaultRemote
Expand Down

0 comments on commit 3d4a44d

Please sign in to comment.