harden document versions
This commit is contained in:
@@ -10,6 +10,12 @@ class IngestJob
|
||||
{
|
||||
public const TYPE_DOCUMENT = 'DOCUMENT';
|
||||
public const TYPE_GLOBAL_REINDEX = 'GLOBAL_REINDEX';
|
||||
/**
|
||||
* Special job type used when a DocumentVersion is activated.
|
||||
* Semantics: always re-ingest the selected version (even if it was previously INDEXED),
|
||||
* ensuring the index reflects the currently active version.
|
||||
*/
|
||||
public const TYPE_DOCUMENT_VERSION_ACTIVATE = 'DOCUMENT_VERSION_ACTIVATE';
|
||||
|
||||
public const STATUS_QUEUED = 'QUEUED';
|
||||
public const STATUS_RUNNING = 'RUNNING';
|
||||
@@ -49,12 +55,12 @@ class IngestJob
|
||||
#[ORM\Column(type: 'text', nullable: true)]
|
||||
private ?string $errorMessage = null;
|
||||
|
||||
public function __construct(string $type)
|
||||
public function __construct(string $type, string $status = self::STATUS_RUNNING)
|
||||
{
|
||||
$this->id = Uuid::v4();
|
||||
$this->type = $type;
|
||||
$this->startedAt = new \DateTimeImmutable();
|
||||
$this->status = self::STATUS_RUNNING;
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
public function getId(): Uuid { return $this->id; }
|
||||
|
||||
Reference in New Issue
Block a user