Skip to content

Commit b2d51a4

Browse files
committed
Delete the URL as well.
1 parent bdfc618 commit b2d51a4

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

rest/cache.rest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Authorization: Bearer {{$dotenv API_TOKEN}}
33
Content-Type: application/json
44

55
{
6-
"tags": ["node:39"]
6+
"tags": ["node:49"]
77
}

workers/handler/src/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ async function cachePurgeTag(batch: MessageBatch, env: Env) {
126126

127127
const ids = results.map<string>(({ id }) => id);
128128

129-
await env.DB.prepare(
130-
`DELETE FROM tag WHERE url IN (${ids.map(() => "?").join(", ")})`,
131-
)
132-
.bind(...ids)
133-
.run();
129+
await env.DB.batch([
130+
env.DB.prepare(
131+
`DELETE FROM tag WHERE url IN (${ids.map(() => "?").join(", ")})`,
132+
).bind(...ids),
133+
env.DB.prepare(
134+
`DELETE FROM url WHERE id IN (${ids.map(() => "?").join(", ")})`,
135+
).bind(...ids),
136+
]);
134137

135138
for (const msg of msgs) {
136139
msg.ack();

0 commit comments

Comments
 (0)