@@ -162,11 +162,11 @@ persistent_replication(_Config) ->
162
162
ok = barrel_replicate :stop_replication (RepId ),
163
163
[{RepId , {true , nil , nil }}] = ets :lookup (replication_ids , RepId ),
164
164
[] = ets :lookup (replication_ids , Pid ),
165
- {ok , [AllConfig2 ]} = file :consult (" data/replication.config " ),
165
+ {ok , [AllConfig2 ]} = file :consult (config_file () ),
166
166
RepConfig2 = maps :get (<<" a" >>, AllConfig2 ),
167
167
#{ <<" source" >> := <<" source" >>, <<" target" >> := <<" testdb" >>, options := Options } = RepConfig2 ,
168
168
ok = barrel_replicate :delete_replication (RepId ),
169
- {ok , [AllConfig3 ]} = file :consult (" data/replication.config " ),
169
+ {ok , [AllConfig3 ]} = file :consult (config_file () ),
170
170
undefined = maps :get (RepId , AllConfig3 , undefined ),
171
171
[] = ets :lookup (replication_ids , RepId ),
172
172
ok .
@@ -195,7 +195,7 @@ restart_persistent_replication(_Config) ->
195
195
{'EXIT' , {badarg , _ }} = (catch ets :lookup (replication_ids , RepId )),
196
196
timer :sleep (200 ),
197
197
ok = barrel_replicate :delete_replication (RepId ),
198
- {ok , [AllConfig3 ]} = file :consult (" data/replication.config " ),
198
+ {ok , [AllConfig3 ]} = file :consult (config_file () ),
199
199
undefined = maps :get (RepId , AllConfig3 , undefined ),
200
200
[] = ets :lookup (replication_ids , RepId ),
201
201
ok .
@@ -390,3 +390,7 @@ read_checkpoint_doc(Db, RepId) ->
390
390
391
391
checkpoint_docid (RepId ) ->
392
392
<<" replication-checkpoint-" , RepId /binary >>.
393
+
394
+
395
+ config_file () ->
396
+ filename :join ([barrel_store :data_dir (), " replication.config" ]).
0 commit comments