Fix BASE_URL config loading, add tasks/projects; robust .env path resolution
- Config: try ENV_FILE, .env, ../.env for loading; trim trailing slash from BaseURL - Log BASE_URL at server startup for verification - .env.example: document BASE_URL - Tasks, projects, tags, migrations and related API/handlers Made-with: Cursor
This commit is contained in:
@@ -105,17 +105,6 @@ func (q *Queries) ListSubscriptionsByCalendar(ctx context.Context, calendarID pg
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const updateSubscriptionLastSynced = `-- name: UpdateSubscriptionLastSynced :exec
|
||||
UPDATE calendar_subscriptions
|
||||
SET last_synced_at = now()
|
||||
WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) UpdateSubscriptionLastSynced(ctx context.Context, id pgtype.UUID) error {
|
||||
_, err := q.db.Exec(ctx, updateSubscriptionLastSynced, id)
|
||||
return err
|
||||
}
|
||||
|
||||
const listSubscriptionsDueForSync = `-- name: ListSubscriptionsDueForSync :many
|
||||
SELECT s.id, s.calendar_id, s.source_url, c.owner_id
|
||||
FROM calendar_subscriptions s
|
||||
@@ -139,10 +128,15 @@ func (q *Queries) ListSubscriptionsDueForSync(ctx context.Context) ([]ListSubscr
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []ListSubscriptionsDueForSyncRow
|
||||
items := []ListSubscriptionsDueForSyncRow{}
|
||||
for rows.Next() {
|
||||
var i ListSubscriptionsDueForSyncRow
|
||||
if err := rows.Scan(&i.ID, &i.CalendarID, &i.SourceUrl, &i.OwnerID); err != nil {
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.CalendarID,
|
||||
&i.SourceUrl,
|
||||
&i.OwnerID,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, i)
|
||||
@@ -152,3 +146,14 @@ func (q *Queries) ListSubscriptionsDueForSync(ctx context.Context) ([]ListSubscr
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const updateSubscriptionLastSynced = `-- name: UpdateSubscriptionLastSynced :exec
|
||||
UPDATE calendar_subscriptions
|
||||
SET last_synced_at = now()
|
||||
WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) UpdateSubscriptionLastSynced(ctx context.Context, id pgtype.UUID) error {
|
||||
_, err := q.db.Exec(ctx, updateSubscriptionLastSynced, id)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user