mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 15:30:41 +09:00
fix: prevent restart downgrades (#951)
Co-authored-by: Loi Nguyen <1948922+lntutor@users.noreply.github.com>
This commit is contained in:
1 parent
9ff090c30b
commit
08651b5917
7 files changed
+189
-1
No files matched your search
@@ -189,6 +189,15 @@ export default class ControlConnection extends BaseConnection {
|
||||
if (!this._controller.canRestart) {
|
||||
throw new lib.RequestError("Cannot restart, controller does not have a process monitor to restart it.");
|
||||
}
|
||||
const downgrade = await this._controller.checkRestartDowngrade();
|
||||
if (downgrade) {
|
||||
const { installedVersion, runningVersion } = downgrade;
|
||||
throw new lib.RequestError(
|
||||
`Cannot restart controller with installed Clusterio version ${installedVersion} because it ` +
|
||||
`is older than running version ${runningVersion}. ` +
|
||||
"Stop the controller before starting the older version manually."
|
||||
);
|
||||
}
|
||||
this._controller.shouldRestart = true;
|
||||
this._controller.stop();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user