From deb50ceff11218e7d8a85fa4a69a6d36a88cf35b Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Fri, 2 Oct 2026 20:04:27 -0400 Subject: [PATCH] Fixed bugs in upgrade logic --- src/utils/upgradeUtils.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/utils/upgradeUtils.js b/src/utils/upgradeUtils.js index f0a3717..971f374 100644 --- a/src/utils/upgradeUtils.js +++ b/src/utils/upgradeUtils.js @@ -35,27 +35,23 @@ module.exports.upgradeCheck = async function(){ //Get the server statistics document from Database const stats = await statModel.getStats(); - //Throw this flag if an upgrade is initiated to automagically and silently initiate all upgrades after it - let upgradeStarted = false; - //If we're upgrading from Panama Red (or older) if(stats.version == "<0.2.0"){ //Initiate upgrade procedure from Panama Red await upgradePanamaRed(); - - //Throw upgrade started flag - upgradeStarted = true; } //If we upgraded - if(upgradeStarted){ + if(stats.version != package.version){ //Update the statistics document to reflect the new version stats.version = package.version; //Write the statistics document to the DB await stats.save(); + + //Shout about successfuly upgrade + loggerUtils.consoleShout(`Database Upgrading to ${package.canopyDisplayVersion} Complete!`); } - loggerUtils.consoleShout(`Database Upgrading to ${package.canopyDisplayVersion} Complete!`); } /**