mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-02-21 07:29:37 +01:00
fix: #78 add new setting to allow publish when uplinks are offline
This commit is contained in:
parent
4a587825f3
commit
430425ce2f
@ -92,6 +92,11 @@ packages:
|
|||||||
# Advanced settings
|
# 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
|
# if you use nginx with custom path, use this to override links
|
||||||
#url_prefix: https://dev.company.local/verdaccio/
|
#url_prefix: https://dev.company.local/verdaccio/
|
||||||
|
|
||||||
|
@ -83,6 +83,9 @@ class Storage {
|
|||||||
// if uplink fails with a status other than 404, we report failure
|
// if uplink fails with a status other than 404, we report failure
|
||||||
if (_.isNil(err_results[i][0]) === false) {
|
if (_.isNil(err_results[i][0]) === false) {
|
||||||
if (err_results[i][0].status !== 404) {
|
if (err_results[i][0].status !== 404) {
|
||||||
|
if (_.isNil(this.config.publish) === false && this.config.publish.allow_offline) {
|
||||||
|
return resolve();
|
||||||
|
}
|
||||||
return reject(Error[503]('one of the uplinks is down, refuse to publish'));
|
return reject(Error[503]('one of the uplinks is down, refuse to publish'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user