Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Upgrade --force to override existing DBRs
Browse files Browse the repository at this point in the history
  • Loading branch information
idan committed May 27, 2015
1 parent c8c24ad commit 86c3bfb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion import_finalized.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ parser.addArgument(
['--force'], {
action: 'storeConst',
dest: 'force',
help: 'Ignore and overwrite an existing staged DBR.',
help: 'Ignore existing DBRs in staging or redshift, and reimport them.',
constant: true
}
)
Expand Down Expand Up @@ -121,9 +121,14 @@ function chooseDBR () {

// Given a latest finalized DBR object, decide whether to import it
function importDBRCheck (finalizedDBR) {
let dbrMonth = finalizedDBR.Month.format('MMMM YYYY')
return redshift.hasMonth(finalizedDBR.Month).then(function (hasMonth) {
if (hasMonth) {
log.info(`No new DBRs to import.`)
if (args.force) {
log.warn(`--force specified, importing DBR for ${dbrMonth} anyways`)
return finalizedDBR
}
cliUtils.runCompleteHandler(startTime, 0)
} else {
return finalizedDBR
Expand Down

0 comments on commit 86c3bfb

Please sign in to comment.