mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-28 09:16:49 +01:00
118 lines
3.8 KiB
JSON
118 lines
3.8 KiB
JSON
|
{
|
||
|
"db_name": "PostgreSQL",
|
||
|
"query": "\nWITH available AS (\n SELECT\n id,\n state\n FROM cyclotron_jobs\n WHERE\n state = 'available'::JobState\n AND queue_name = $1\n AND scheduled <= NOW()\n ORDER BY\n priority ASC,\n scheduled ASC\n LIMIT $2\n FOR UPDATE SKIP LOCKED\n)\nUPDATE cyclotron_jobs\nSET\n state = 'running'::JobState,\n lock_id = $3,\n last_heartbeat = NOW(),\n last_transition = NOW(),\n transition_count = transition_count + 1\nFROM available\nWHERE\n cyclotron_jobs.id = available.id\nRETURNING\n cyclotron_jobs.id,\n team_id,\n available.state as \"state: JobState\",\n queue_name,\n priority,\n function_id,\n created,\n last_transition,\n scheduled,\n transition_count,\n vm_state,\n metadata,\n parameters,\n lock_id,\n last_heartbeat,\n janitor_touch_count\n ",
|
||
|
"describe": {
|
||
|
"columns": [
|
||
|
{
|
||
|
"ordinal": 0,
|
||
|
"name": "id",
|
||
|
"type_info": "Uuid"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 1,
|
||
|
"name": "team_id",
|
||
|
"type_info": "Int4"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 2,
|
||
|
"name": "state: JobState",
|
||
|
"type_info": {
|
||
|
"Custom": {
|
||
|
"name": "jobstate",
|
||
|
"kind": {
|
||
|
"Enum": ["available", "completed", "failed", "running", "paused"]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 3,
|
||
|
"name": "queue_name",
|
||
|
"type_info": "Text"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 4,
|
||
|
"name": "priority",
|
||
|
"type_info": "Int2"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 5,
|
||
|
"name": "function_id",
|
||
|
"type_info": "Uuid"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 6,
|
||
|
"name": "created",
|
||
|
"type_info": "Timestamptz"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 7,
|
||
|
"name": "last_transition",
|
||
|
"type_info": "Timestamptz"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 8,
|
||
|
"name": "scheduled",
|
||
|
"type_info": "Timestamptz"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 9,
|
||
|
"name": "transition_count",
|
||
|
"type_info": "Int2"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 10,
|
||
|
"name": "vm_state",
|
||
|
"type_info": "Text"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 11,
|
||
|
"name": "metadata",
|
||
|
"type_info": "Text"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 12,
|
||
|
"name": "parameters",
|
||
|
"type_info": "Text"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 13,
|
||
|
"name": "lock_id",
|
||
|
"type_info": "Uuid"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 14,
|
||
|
"name": "last_heartbeat",
|
||
|
"type_info": "Timestamptz"
|
||
|
},
|
||
|
{
|
||
|
"ordinal": 15,
|
||
|
"name": "janitor_touch_count",
|
||
|
"type_info": "Int2"
|
||
|
}
|
||
|
],
|
||
|
"parameters": {
|
||
|
"Left": ["Text", "Int8", "Uuid"]
|
||
|
},
|
||
|
"nullable": [
|
||
|
false,
|
||
|
false,
|
||
|
false,
|
||
|
false,
|
||
|
false,
|
||
|
true,
|
||
|
false,
|
||
|
false,
|
||
|
false,
|
||
|
false,
|
||
|
true,
|
||
|
true,
|
||
|
true,
|
||
|
true,
|
||
|
true,
|
||
|
false
|
||
|
]
|
||
|
},
|
||
|
"hash": "c624261597b9356ff3e7c3e392a84bb0b551e91c503e8b21c29814f1eb660a8e"
|
||
|
}
|