mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #60826 from nextcloud/backport/60765/stable34
[stable34] Background jobs improvements
This commit is contained in:
commit
8c70e5968a
5 changed files with 8 additions and 4 deletions
|
|
@ -38,6 +38,8 @@ class Version34000Date20260518163022 extends SimpleMigrationStep {
|
|||
$table->addColumn('class_name', Types::STRING, ['notnull' => true, 'length' => 255]);
|
||||
$table->setPrimaryKey(['class_id']);
|
||||
$table->addUniqueConstraint(['class_name'], 'class_index');
|
||||
// Makes sure there is no auto-increment in Oracle
|
||||
$schema->dropAutoincrementColumn('job_classes_registry', 'class_id');
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ class Version34000Date20260521110333 extends SimpleMigrationStep {
|
|||
$table->addColumn('ram_peak_usage', Types::INTEGER, ['notnull' => true, 'default' => 0]); // Should be MEDIUMINT
|
||||
$table->setPrimaryKey(['run_id']);
|
||||
$table->addIndex(['status'], 'status');
|
||||
// Makes sure there is no auto-increment in Oracle
|
||||
$schema->dropAutoincrementColumn('job_runs', 'run_id');
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ final readonly class JobRuns implements IJobRuns {
|
|||
$row['run_id'],
|
||||
$this->classesRegistry->getName($row['class_id']),
|
||||
$snowflakeInfo->getServerId(),
|
||||
$row['pid'],
|
||||
(int)$row['pid'],
|
||||
$snowflakeInfo->getCreatedAt(),
|
||||
JobStatus::from($row['status']),
|
||||
JobStatus::from((int)$row['status']),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class SchemaWrapper implements ISchemaWrapper {
|
|||
#[\Override]
|
||||
public function dropAutoincrementColumn(string $table, string $column): void {
|
||||
$tableObj = $this->schema->getTable($this->connection->getPrefix() . $table);
|
||||
$tableObj->modifyColumn('id', ['autoincrement' => false]);
|
||||
$tableObj->modifyColumn($column, ['autoincrement' => false]);
|
||||
$platform = $this->getDatabasePlatform();
|
||||
if ($platform instanceof OraclePlatform) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ final readonly class JobRun {
|
|||
*/
|
||||
public function __construct(
|
||||
/** Run ID (Snowflake ID) */
|
||||
public int $runId,
|
||||
public int|string $runId,
|
||||
/** Class name */
|
||||
public string $className,
|
||||
/** Server ID */
|
||||
|
|
|
|||
Loading…
Reference in a new issue