diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-03-21 14:22:51 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-03-21 14:22:51 +0000 |
| commit | 0e112d9f52d032bd1e555fc6a3a7180abc32c71f (patch) | |
| tree | f6c8bacdc3a399fc5216096fef4951a31f1609a5 /src | |
| parent | e4629e618b6605d135fa1b0c1f64f558127797fa (diff) | |
| download | rabbitmq-server-git-0e112d9f52d032bd1e555fc6a3a7180abc32c71f.tar.gz | |
maybe_remove_backup is safe when returning version_not_available since we would not have taken a backup in the first place. However, this is not exactly obvious, so let's not do that.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_upgrade.erl | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/rabbit_upgrade.erl b/src/rabbit_upgrade.erl index b9c7b8dce2..73c9ee2b3e 100644 --- a/src/rabbit_upgrade.erl +++ b/src/rabbit_upgrade.erl @@ -273,16 +273,15 @@ node_running(Node) -> %% ------------------------------------------------------------------- maybe_upgrade_local() -> - Res = case rabbit_version:upgrades_required(local) of - {error, version_not_available} -> version_not_available; - {error, _} = Err -> throw(Err); - {ok, []} -> ok; - {ok, Upgrades} -> mnesia:stop(), - apply_upgrades(local, Upgrades, - fun () -> ok end) - end, - maybe_remove_backup(), - Res. + case rabbit_version:upgrades_required(local) of + {error, version_not_available} -> version_not_available; + {error, _} = Err -> throw(Err); + {ok, []} -> maybe_remove_backup(); + {ok, Upgrades} -> mnesia:stop(), + apply_upgrades(local, Upgrades, + fun () -> ok end), + maybe_remove_backup() + end. %% ------------------------------------------------------------------- |
