mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
## What kind of change does this PR introduce? a11y bug fix on youtube embed ## What is the current behavior? YouTube iframes across guide pages have no `title` attribute, so screen readers announce them as an unnamed frame ## What is the new behavior? - extracts a `YouTube.tsx` ui component - adds `<YouTube id title />` + `title` as a required prop ## Test 1. visit `/docs/guides/ai/examples/openai` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Standardized embedded YouTube videos across guides with a consistent video player. - Added descriptive titles to improve accessibility and clarity. - Preserved existing video content and playback behavior. - Updated video embeds across AI, authentication, database, functions, realtime, self-hosting, storage, and migration documentation. - **New Features** - Added privacy-enhanced YouTube playback for embedded documentation videos. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
55 lines
1.7 KiB
Plaintext
55 lines
1.7 KiB
Plaintext
---
|
|
id: 'schedule-functions'
|
|
title: 'Scheduling Edge Functions'
|
|
description: 'Schedule Edge Functions with pg_cron.'
|
|
---
|
|
|
|
<YouTube id="-U6DJcjVvGo" title="Scheduling Edge Functions with pg_cron" />
|
|
|
|
The hosted Supabase Platform supports the [`pg_cron` extension](/docs/guides/database/extensions/pg_cron), a recurring job scheduler in Postgres.
|
|
|
|
In combination with the [`pg_net` extension](/docs/guides/database/extensions/pg_net), this allows us to invoke Edge Functions periodically on a set schedule.
|
|
|
|
<Admonition type="caution">
|
|
|
|
To access the auth token securely for your Edge Function call, we recommend storing them in [Supabase Vault](/docs/guides/database/vault).
|
|
|
|
</Admonition>
|
|
|
|
## Examples
|
|
|
|
### Invoke an Edge Function every minute
|
|
|
|
Store `project_url` and `publishable_key` in Supabase Vault:
|
|
|
|
```sql
|
|
select vault.create_secret('https://project-ref.supabase.co', 'project_url');
|
|
select vault.create_secret('YOUR_SUPABASE_PUBLISHABLE_KEY', 'publishable_key');
|
|
```
|
|
|
|
Make a POST request to a Supabase Edge Function every minute:
|
|
|
|
```sql
|
|
select
|
|
cron.schedule(
|
|
'invoke-function-every-minute',
|
|
'* * * * *', -- every minute
|
|
$$
|
|
select
|
|
net.http_post(
|
|
url:= (select decrypted_secret from vault.decrypted_secrets where name = 'project_url') || '/functions/v1/function-name',
|
|
headers:=jsonb_build_object(
|
|
'Content-type', 'application/json',
|
|
'apikey', (select decrypted_secret from vault.decrypted_secrets where name = 'publishable_key')
|
|
),
|
|
body:=concat('{"time": "', now(), '"}')::jsonb
|
|
) as request_id;
|
|
$$
|
|
);
|
|
```
|
|
|
|
## Resources
|
|
|
|
- [`pg_net` extension](/docs/guides/database/extensions/pg_net)
|
|
- [`pg_cron` extension](/docs/guides/database/extensions/pg_cron)
|