Skip to content

Instantly share code, notes, and snippets.

@sideshowcoder
Created June 9, 2014 10:50
Show Gist options
  • Save sideshowcoder/b48433984955b0bb99cb to your computer and use it in GitHub Desktop.
Save sideshowcoder/b48433984955b0bb99cb to your computer and use it in GitHub Desktop.
def start_replication
@pull = @database.createPullReplication(sync_url)
@pull.continuous = true
@push = @database.createPushReplication(sync_url)
@push.continuous = true
listen_for_replication_events @pull
listen_for_replication_events @push
authenticator.register_credentials_for_replications [@push, @pull]
# re-start the replications
@pull.stop
@pull.start
@push.stop
@push.start
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment