mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:07:08 +00:00
Update version checking mechanism.
Checks both database schema and API versions.
This commit is contained in:
@@ -5,7 +5,7 @@ async function main () {
|
||||
const version = require('./lib/version');
|
||||
console.log("Running version", await version.describe());
|
||||
version.compatible()
|
||||
.then( () => {
|
||||
.then( (versions) => {
|
||||
const api = require('./api');
|
||||
const ws = require('./ws');
|
||||
|
||||
@@ -17,10 +17,12 @@ async function main () {
|
||||
const eventManagerPath = [__dirname, "events"].join("/");
|
||||
const eventManager = fork(eventManagerPath, /*{ stdio: 'ignore' }*/);
|
||||
|
||||
console.info("Versions", versions);
|
||||
|
||||
process.on('exit', () => eventManager.kill());
|
||||
})
|
||||
.catch( ({current, wanted}) => {
|
||||
console.error(`Fatal error: incompatible database schema version ${current} (wanted: ${wanted})`);
|
||||
.catch( ({current, wanted, component}) => {
|
||||
console.error(`Fatal error: incompatible ${component} version ${current} (wanted: ${wanted})`);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user