mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 09:45:36 +08:00
perf(cron): share global concurrency budget and streamline execution
Share durable permits across manual, scheduled and recovered runs, prioritize short ready tasks with aging, and record global queue occupancy. Reduce launch, log polling, dashboard and SQLite overhead while preserving transactional receipts, cancellation, recovery and script hook compatibility. Keep ordinary CRUD in ORM and bound SQL on measured execution hot paths. Fix supervisor descendant tracking, asynchronous log draining, concurrent log directory creation, Linux fallback launches and snapshot clock rollback. Include regression coverage, SQL audits and evolution/review documentation. Validation: five review rounds; local full suite 1478 passed, 28 platform skips; dev suites 415 passed, no failures/skips; backend types and formatting passed.
This commit is contained in:
1 parent
cddabbaf0e
commit
2f01f756d7
74 files changed
+6891
-837
No files matched your search
@@ -53,7 +53,11 @@ export class TriggerQueries {
|
||||
scriptStartP95: number | null;
|
||||
scriptOnTime: number;
|
||||
}>(
|
||||
`WITH today AS (SELECT * FROM CronTriggers WHERE observed_at >= $since),
|
||||
// Reuse a narrow snapshot: inlining this CTE makes each count/percentile
|
||||
// revisit the wide trigger rows, including their queue diagnostics.
|
||||
`WITH today AS MATERIALIZED (
|
||||
SELECT state,observed_at,scheduled_at,started_at,script_started_at,dequeued_at,queued_at
|
||||
FROM CronTriggers WHERE observed_at >= $since),
|
||||
triggers AS (SELECT ABS(observed_at - scheduled_at) AS deviation FROM today WHERE scheduled_at IS NOT NULL),
|
||||
scripts AS (SELECT script_started_at - scheduled_at AS delay FROM today
|
||||
WHERE scheduled_at IS NOT NULL AND script_started_at >= scheduled_at),
|
||||
|
||||
Reference in new issue
Block a user