There are unique fields in the User table which can cause conflicts. So we introuduced the on_conflict: :nothing
.
Repo.insert_all(
User,
[
%{
user_id: user.id,
wallet_source_id: source_id,
number: "..."
},
%{
user_id: user_2.id,
wallet_source_id: source_2.id,
number: "..."
}
],
returning: false,
on_conflict: :nothing
)
Subsequently, no unique constraint errors but we are seeing postgres throwing
** (Postgrex.Error) ERROR 57014 (query_canceled) canceling statement due to user request
Any insights to the possible root cause?