Browse Source

Make now scale ls to work with static deployments

master
Jarmo Isotalo 8 years ago
parent
commit
14dbbcec41
  1. 21
      bin/now-scale.js
  2. 3
      lib/alias.js

21
bin/now-scale.js

@ -267,7 +267,26 @@ async function list(scale) {
)
)
for (const instance of depls) {
if (instance.scale.current > 0) {
if (!instance.scale) {
let spec
if (supportsColor) {
spec = ` %-${urlLength + 10}s %8s %8s %8s %8s %8s`
} else {
spec = ` %-${urlLength + 1}s %8s %8s %8s %8s %8s`
}
const infinite = '∞'
console.log(
printf(
spec,
chalk.underline(instance.url),
infinite,
1,
infinite,
'✔',
ms(timeNow - instance.created)
)
)
} else if (instance.scale.current > 0) {
let spec
if (supportsColor) {
spec = ` %-${urlLength + 10}s %8s %8s %8s %8s %8s`

3
lib/alias.js

@ -259,10 +259,11 @@ module.exports = class Alias extends Now {
let aliasedDeployment = null
let shouldScaleDown = false
if (aliasDepl) {
if (aliasDepl && depl.scale) {
aliasedDeployment = await this.findDeployment(aliasDepl.deploymentId)
if (
aliasedDeployment &&
aliasedDeployment.scale &&
aliasedDeployment.scale.current >= depl.scale.current &&
(aliasedDeployment.scale.min > depl.scale.min ||
aliasedDeployment.scale.max > depl.scale.max)

Loading…
Cancel
Save