-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove log files in Realm.deleteRealm #2839
Conversation
@finnschiermer Please review. |
👍 @finnschiermer Please see if we have overlooked some aux. files. |
After a brief chat with @finnschiermer, it is safer to remove all files in the |
👍 |
@@ -1922,14 +1911,15 @@ public void run() { | |||
realm.beginTransaction(); | |||
realm.createObject(AllTypes.class); | |||
realm.commitTransaction(); | |||
// Move the directory so core won't be able to delete log files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead describe why it could happen, i.e during an upgrade of Realm where core changed the location of log files.
Apart from minor comment 👍 |
new File(rootFolder, realmFileName + ".log_a"), | ||
new File(rootFolder, realmFileName + ".log_b"), | ||
new File(rootFolder, realmFileName + ".log"), | ||
// New styles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those four lines can be removed.
👍 |
// there is no subfolders in the management folder | ||
File[] files = managementFolder.listFiles(); | ||
if (files != null) { | ||
for (File file : files) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick, but use a simple for loop instead to save the allocation of an iterator.
👍 |
1 similar comment
👍 |
Close #2834