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
@@ -43,17 +43,26 @@ async function probeUpgrade() {
|
||||
try {
|
||||
await loadDatabase();
|
||||
// Exercise an actual on-disk transaction as well as schema initialization.
|
||||
const { DataTypes } = await import('sequelize');
|
||||
const probe = sequelize.define<
|
||||
import('sequelize').Model<{ value: number }>
|
||||
>(
|
||||
'UpgradeProbe',
|
||||
{ value: DataTypes.INTEGER },
|
||||
{ tableName: 'upgrade_probe', timestamps: false },
|
||||
);
|
||||
probe.removeAttribute('id');
|
||||
await sequelize.transaction(async (transaction) => {
|
||||
await sequelize.query('CREATE TABLE upgrade_probe (value INTEGER)', {
|
||||
transaction,
|
||||
});
|
||||
await sequelize.query('INSERT INTO upgrade_probe VALUES (42)', {
|
||||
transaction,
|
||||
});
|
||||
const [rows] = await sequelize.query('SELECT value FROM upgrade_probe', {
|
||||
transaction,
|
||||
});
|
||||
if ((rows[0] as { value: number })?.value !== 42)
|
||||
await sequelize
|
||||
.getQueryInterface()
|
||||
.createTable(
|
||||
'upgrade_probe',
|
||||
{ value: DataTypes.INTEGER },
|
||||
{ transaction },
|
||||
);
|
||||
await probe.create({ value: 42 }, { transaction });
|
||||
const row = await probe.findOne({ attributes: ['value'], transaction });
|
||||
if (row?.get('value') !== 42)
|
||||
throw new Error('Upgrade database readback failed');
|
||||
});
|
||||
inject();
|
||||
|
||||
Reference in new issue
Block a user