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

Expose a block to determine if the Realm should be compacted on launch #4755

Merged
merged 10 commits into from
Apr 17, 2017

Conversation

jpsim
Copy link
Contributor

@jpsim jpsim commented Mar 21, 2017

Addresses #3289.

@jpsim jpsim force-pushed the jp-compact-on-launch branch from c6bac68 to 418470c Compare April 17, 2017 03:39
@jpsim jpsim force-pushed the jp-compact-on-launch branch from 418470c to eae469b Compare April 17, 2017 04:01
@jpsim jpsim requested review from tgoyne and austinzheng April 17, 2017 04:02
@jpsim jpsim changed the title WIP compact on launch Expose a block to determine if the Realm should be compacted on launch Apr 17, 2017
@jpsim
Copy link
Contributor Author

jpsim commented Apr 17, 2017

This is now ready for review.


- (void)testCompactOnLaunchCannotBeSet {
// This test just needs a single process, so skip child.
if (!self.isParent) { return; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The child process is created by RLMRunChildAndWait(), so there's no need to do anything other than just not call that if only one process is needed.

@@ -275,4 +279,21 @@ - (NSString *)pathOnDisk {
return @(_config.path.c_str());
}

- (void)setShouldCompactOnLaunch:(RLMShouldCompactOnLaunchBlock)shouldCompactOnLaunch {
_shouldCompactOnLaunch = shouldCompactOnLaunch;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should set this after validation so that the object isn't left in an inconsistent state when validation fails.

jpsim added 2 commits April 17, 2017 09:26
to prevent the configuration from being left in an
inconsistent state
Copy link
Contributor

@austinzheng austinzheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,86 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2015 Realm Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2017

@jpsim jpsim merged commit 5f102a3 into master Apr 17, 2017
@jpsim jpsim deleted the jp-compact-on-launch branch April 17, 2017 18:18
@jpsim jpsim removed the S:Review label Apr 17, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 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.

3 participants