Browse Source

Replication options: Fix line length. maps:get

Mikhail Kalashnikov 6 years ago
parent
commit
15ea223e6a
3 changed files with 4 additions and 3 deletions
  1. 1 1
      src/commands/epgsql_cmd_start_replication.erl
  2. 2 1
      src/epgsql.erl
  3. 1 1
      src/epgsql_replication.hrl

+ 1 - 1
src/commands/epgsql_cmd_start_replication.erl

@@ -48,7 +48,7 @@ execute(Sock, #start_repl{slot = ReplicationSlot, callback = Callback,
 
     Hex = [H || H <- WALPosition, H =/= $/],
     {ok, [LSN], _} = io_lib:fread("~16u", Hex),
-    AlignLsn = proplists:get_value(align_lsn, Opts, false),
+    AlignLsn = maps:get(align_lsn, Opts, false),
     Repl3 = Repl2#repl{last_flushed_lsn = LSN,
                        last_applied_lsn = LSN,
                        align_lsn = AlignLsn},

+ 2 - 1
src/epgsql.erl

@@ -423,7 +423,8 @@ handle_x_log_data(Mod, StartLSN, EndLSN, WALRecord, Repl) ->
     [replication_option()]
     | #{align_lsn => boolean()}.
 
--spec start_replication(connection(), string(), Callback, cb_state(), string(), string(), replication_opts()) -> Response when
+-spec start_replication(connection(), string(), Callback, cb_state(), string(), string(), replication_opts()) ->
+    Response when
     Response :: epgsql_cmd_start_replication:response(),
     Callback :: module() | pid().
 %% @doc instructs Postgres server to start streaming WAL for logical replication

+ 1 - 1
src/epgsql_replication.hrl

@@ -7,5 +7,5 @@
           cbmodule :: module() | undefined,
           cbstate :: any() | undefined,
           receiver :: pid() | undefined,
-          align_lsn :: integer() | undefined
+          align_lsn :: boolean() | undefined
         }).