Merge pull request #1090 from CartoDB/graceful-shutdown

Use semver for cheking dependencies version
This commit is contained in:
Daniel G. Aubert 2019-03-29 15:40:12 +01:00 committed by GitHub
commit 4ffbcea819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
'use strict';
const _ = require('underscore');
const semver = require('semver');
const express = require('express');
const windshaft = require('windshaft');
const { mapnik } = windshaft;
@ -82,7 +83,7 @@ function getAndValidateVersions(options) {
dependenciesToValidate.forEach(function(depName) {
var declaredDependencyVersion = declaredDependencies[depName];
var installedDependencyVersion = installedDependenciesVersions[depName];
if (declaredDependencyVersion !== installedDependencyVersion) {
if (!semver.satisfies(installedDependencyVersion,declaredDependencyVersion)) {
warn(
'Dependency="%s" installed version="%s" does not match declared version="%s". Check your installation.',
depName, installedDependencyVersion, declaredDependencyVersion