Enums¶
JobPriority¶
- class pg_scheduler.JobPriority(value)[source]¶
Bases:
EnumJob priority levels for scheduling.
Lower priority numbers indicate higher priority (jobs execute first). Jobs are processed in ascending priority order: 1 → 3 → 5 → 8.
- CRITICAL = 'critical'¶
- HIGH = 'high'¶
- NORMAL = 'normal'¶
- LOW = 'low'¶
- property db_value: int¶
Get the database integer value for this priority level.
- Returns:
Database priority value (1, 3, 5, or 8)
- Return type:
Note
Lower numbers = higher priority. Used for ORDER BY in SQL queries.
- classmethod from_db_value(db_value: int) JobPriority[source]¶
Convert a database integer value back to a JobPriority enum.
- Parameters:
db_value – The integer priority value from the database (1, 3, 5, or 8)
- Returns:
The corresponding priority enum member
- Return type:
Note
If an unknown value is provided, defaults to NORMAL.