mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-04-01 02:42:23 -05:00
Merge pull request #223 from verdaccio/fix_78
Fix #78 Add new setting to allow publish when uplinks are offline
This commit is contained in:
commit
90854b2c51
2 changed files with 10 additions and 0 deletions
|
@ -92,6 +92,11 @@ packages:
|
|||
# Advanced settings
|
||||
#####################################################################
|
||||
|
||||
## Special packages publish configurations
|
||||
#publish:
|
||||
## This will allow the publisher to publish packages even if any uplink is down.
|
||||
# allow_offline: true
|
||||
|
||||
# if you use nginx with custom path, use this to override links
|
||||
#url_prefix: https://dev.company.local/verdaccio/
|
||||
|
||||
|
|
|
@ -83,6 +83,11 @@ class Storage {
|
|||
// if uplink fails with a status other than 404, we report failure
|
||||
if (_.isNil(err_results[i][0]) === false) {
|
||||
if (err_results[i][0].status !== 404) {
|
||||
if (_.isNil(this.config.publish) === false &&
|
||||
_.isBoolean(this.config.publish.allow_offline) &&
|
||||
this.config.publish.allow_offline) {
|
||||
return resolve();
|
||||
}
|
||||
return reject(Error[503]('one of the uplinks is down, refuse to publish'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue