feat: implement per-project GitHub sync scheduler with dynamic intervals

Replaces fixed-interval polling with a priority queue scheduler that adjusts
check frequency based on activity recency (15min for active projects, up to
24hr for stale ones). Includes exponential backoff on errors and staggered
initial checks to prevent API rate limit issues.
This commit is contained in:
2026-01-15 00:40:09 -06:00
parent 231a7680ac
commit 95cb98b084
7 changed files with 521 additions and 151 deletions
@@ -0,0 +1,86 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT\n id,\n slug,\n name,\n short_description,\n description,\n status as \"status: ProjectStatus\",\n github_repo,\n demo_url,\n last_github_activity,\n created_at\n FROM projects\n WHERE github_repo IS NOT NULL\n ORDER BY last_github_activity DESC NULLS LAST\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "slug",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "short_description",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "description",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "status: ProjectStatus",
"type_info": {
"Custom": {
"name": "project_status",
"kind": {
"Enum": [
"active",
"maintained",
"archived",
"hidden"
]
}
}
}
},
{
"ordinal": 6,
"name": "github_repo",
"type_info": "Text"
},
{
"ordinal": 7,
"name": "demo_url",
"type_info": "Text"
},
{
"ordinal": 8,
"name": "last_github_activity",
"type_info": "Timestamptz"
},
{
"ordinal": 9,
"name": "created_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false,
false,
false,
false,
true,
true,
true,
false
]
},
"hash": "a0ef356b59f222775d062f6ae929f1566c0a50501c4b5e894caa3d3eb5b739f0"
}