Просмотр исходного кода

docs: add critical warning about pg_cron database settings #23

- Document required app.internal_sync_secret and app.supabase_url settings
- Explain why these are critical for scheduled sync functionality
- Add verification SQL query
- Clarify failure mode when settings are missing

Fixes #23 - auto sync not started due to missing database config
Claude 5 месяцев назад
Родитель
Сommit
738cc7ae26
1 измененных файлов с 16 добавлено и 1 удалено
  1. 16 1
      CLAUDE.md

+ 16 - 1
CLAUDE.md

@@ -452,13 +452,28 @@ RESEND_API_KEY=your_resend_api_key
 
 ### Supabase Database Settings (for pg_cron)
 
-Configure in Supabase Dashboard → Project Settings → Database → Custom Postgres Configuration:
+**CRITICAL**: Configure in Supabase Dashboard → Project Settings → Database → Custom Postgres Configuration:
 
 ```
 app.internal_sync_secret = 'same_as_INTERNAL_SYNC_SECRET_above'
 app.supabase_url = 'https://YOUR_PROJECT.supabase.co'
 ```
 
+**Why this is required**: The pg_cron jobs run database-side trigger functions that need to make HTTP requests to Edge Functions. These settings allow the trigger functions to authenticate and call the scheduled sync Edge Functions.
+
+**Without these settings**:
+- pg_cron jobs will run successfully but silently fail
+- No sync will actually happen (appears "stuck")
+- No error logs will be visible
+
+**To verify settings are configured**:
+```sql
+SELECT
+  current_setting('app.internal_sync_secret', true) as internal_secret,
+  current_setting('app.supabase_url', true) as supabase_url;
+```
+Both values should be non-NULL.
+
 ## Deployment
 
 ### Frontend