Surgex v2.2.1 Surgex.DataPipe.FollowerSync
Waits for a PostgreSQL slave synchronization with a remote master.
Usage
Can be configured globally or per repo as follows:
config :surgex,
follower_sync_enabled: true,
follower_sync_timeout: 15_000,
follower_sync_interval: 1_000
config :my_project, MyProject.MyRepo,
# ...
follower_sync_enabled: true,
follower_sync_timeout: 15_000,
follower_sync_interval: 1_000
As a convenience versus calling Surgex.DataPipe.FollowerSync.call/2
all the time, it can be
use
d in a repo module as follows:
defmodule MyProject.MyRepo do
use Surgex.DataPipe.FollowerSync
end
MyProject.MyRepo.ensure_follower_sync(lsn)
Refer to Surgex.DataPipe
for a complete data pipe example.