Question

Supabase Edge Function times out after 150 seconds on a big import

Solved · 9 views · asked by sam_builds · edited

Importing a 20,000-row CSV through an Edge Function. It dies at 150 seconds with about 8,000 rows done.

What I’ve tried

Increased batch size to 1,000. Slightly faster, still times out.

Comment

1 answer

Marked as helpful by the asker
olu_backend · edited

Edge Functions have a hard wall-clock limit; you cannot raise it. Make the work fit:

  • Upload the CSV to Storage, then run the import in the database with copy via a pg_net trigger or supabase db CLI. Postgres eats 20k rows in under a second.
  • Or split: the function processes 2,000 rows, writes progress to a table, and re-invokes itself.

For a one-off import, just run psql \copy from your laptop.

Comment