fix(don): dont conflict
Build and Push Image / build-backend (push) Successful in 19s
Build and Push Image / build-frontend (push) Successful in 1m14s
Build and Push Image / push (push) Successful in 47s

This commit is contained in:
2026-06-10 16:27:04 +07:00 Unverified
parent 03f2f941a3
commit bb8e8c8ee1
+13 -12
View File
@@ -201,7 +201,8 @@ export default async function () {
}) })
.returning({ id: donations.id }); .returning({ id: donations.id });
if ($.artifact === "true") { if ($.artifact === "true") {
const res = await tx // const res = await tx
await tx
.insert(submissions) .insert(submissions)
.values({ .values({
name, name,
@@ -215,17 +216,17 @@ export default async function () {
// queue: null as unknown as undefined, // queue: null as unknown as undefined,
// }, // },
// }) // })
.onConflictDoNothing() .onConflictDoNothing();
.catch(() => "conflict"); // .catch(() => "conflict");
if (res === "conflict") { // if (res === "conflict") {
tx.rollback(); // tx.rollback();
ph.capture({ // ph.capture({
distinctId, // distinctId,
event: "donation_artifact_conflict", // event: "donation_artifact_conflict",
properties: { amount: $.amount, uid: $.uid }, // properties: { amount: $.amount, uid: $.uid },
}); // });
return { error: { where: "uid", what: "ไม่สามารถสร้างคิวลัดได้" } }; // return { error: { where: "uid", what: "ไม่สามารถสร้างคิวลัดได้" } };
} // }
} }
if ($.amount >= 10) if ($.amount >= 10)
sse.donate.pub("ping", { sse.donate.pub("ping", {