diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2011-02-16 12:03:22 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2011-02-16 12:03:22 +0000 |
commit | 46b79df30bb8eac1905dfd2cc73e760f753b99f6 (patch) | |
tree | e701986e3296b414219f19a8722d28c9f8da23e7 | |
parent | 789f49a33719c34d11c4385e67e46ac6bc081617 (diff) | |
download | rabbitmq-server-46b79df30bb8eac1905dfd2cc73e760f753b99f6.tar.gz |
Aesthetics
-rw-r--r-- | src/rabbit_msg_store.erl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_msg_store.erl b/src/rabbit_msg_store.erl index fd3027e9..3d7411a9 100644 --- a/src/rabbit_msg_store.erl +++ b/src/rabbit_msg_store.erl @@ -1986,16 +1986,14 @@ transform_dir(BaseDir, Store, TransformFun) -> TmpDir = filename:join(Dir, ?TRANSFORM_TMP), TransformFile = fun (A, B) -> transform_msg_file(A, B, TransformFun) end, case filelib:is_dir(TmpDir) of - true -> - throw({error, transform_failed_previously}); - false -> - OldFileList = list_sorted_file_names(Dir, ?FILE_EXTENSION), - for_each_file(Dir, TmpDir, TransformFile, OldFileList), - for_each_file(Dir, fun file:delete/1, OldFileList), - NewFileList = list_sorted_file_names(TmpDir, ?FILE_EXTENSION), - for_each_file(TmpDir, Dir, fun file:copy/2, NewFileList), - for_each_file(TmpDir, fun file:delete/1, NewFileList), - ok = file:del_dir(TmpDir) + true -> throw({error, transform_failed_previously}); + false -> OldFileList = list_sorted_file_names(Dir, ?FILE_EXTENSION), + for_each_file(Dir, TmpDir, TransformFile, OldFileList), + for_each_file(Dir, fun file:delete/1, OldFileList), + NewFileList = list_sorted_file_names(TmpDir, ?FILE_EXTENSION), + for_each_file(TmpDir, Dir, fun file:copy/2, NewFileList), + for_each_file(TmpDir, fun file:delete/1, NewFileList), + ok = file:del_dir(TmpDir) end. transform_msg_file(FileOld, FileNew, TransformFun) -> |