Skip to content
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

Merged
merged 3 commits into from
May 19, 2016
Merged

Remove log files in Realm.deleteRealm #2839

merged 3 commits into from
May 19, 2016

Conversation

beeender
Copy link
Contributor

Close #2834

@beeender beeender added this to the 0.91 milestone May 19, 2016
@bmunkholm
Copy link
Contributor

@finnschiermer Please review.

@kneth
Copy link
Contributor

kneth commented May 19, 2016

👍

@finnschiermer Please see if we have overlooked some aux. files.

@kneth
Copy link
Contributor

kneth commented May 19, 2016

After a brief chat with @finnschiermer, it is safer to remove all files in the .management folder. See http://stackoverflow.com/questions/7768071/how-to-delete-directory-content-in-java how to do so.

@stk1m1
Copy link
Contributor

stk1m1 commented May 19, 2016

👍

@@ -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
Copy link
Contributor

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.

@cmelchior
Copy link
Contributor

Apart from minor comment 👍

new File(rootFolder, realmFileName + ".log_a"),
new File(rootFolder, realmFileName + ".log_b"),
new File(rootFolder, realmFileName + ".log"),
// New styles
Copy link
Contributor Author

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.

@emanuelez
Copy link
Contributor

👍

// there is no subfolders in the management folder
File[] files = managementFolder.listFiles();
if (files != null) {
for (File file : files) {
Copy link
Contributor

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.

@zaki50
Copy link
Contributor

zaki50 commented May 19, 2016

👍

1 similar comment
@nhachicha
Copy link
Collaborator

👍

@beeender beeender merged commit 165915e into master May 19, 2016
@beeender beeender removed the S:Review label May 19, 2016
@beeender beeender deleted the mc/bug/2834 branch May 19, 2016 14:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants