1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Deno KV】delete all entries purge【TRUNCATE】TypeError: KV storage quota is exhausted.【Deno Deploy】

1
Last updated at Posted at 2024-02-28
const kv = await Deno.openKv();

Deno.cron("delete all entries", "* * * * *", async () => {
    console.log(new Date())
    const start = Date.now()
    const entries = kv.list({ prefix: [] });
    for await (const entry of entries) {
        kv.delete(entry.key);
    }
    console.log((Date.now() - start) / 1000)
});

全消しするのに結構時間かかります。進捗はダッシュボードをリロードしましょう

image.png

Deno Deployで怒られた

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?