|
@@ -89,8 +89,6 @@ class CleanWorkToDo extends BaseCronJob
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $this->connection->setAutoCommit(false);
|
|
|
|
|
-
|
|
|
|
|
$deleted = 0;
|
|
$deleted = 0;
|
|
|
|
|
|
|
|
$this->ui->progress(0, $total);
|
|
$this->ui->progress(0, $total);
|
|
@@ -105,19 +103,19 @@ class CleanWorkToDo extends BaseCronJob
|
|
|
|
|
|
|
|
// Set DELETION_REQUESTED status for all associated files
|
|
// Set DELETION_REQUESTED status for all associated files
|
|
|
$this->connection->executeStatement(
|
|
$this->connection->executeStatement(
|
|
|
- "UPDATE file SET status = ? WHERE work_id = ? AND host = ?",
|
|
|
|
|
- [FileStatusEnum::DELETION_REQUESTED->value, $workId, FileHostEnum::AP2I->value]
|
|
|
|
|
|
|
+ "UPDATE File SET status = ? WHERE work_id = ?",
|
|
|
|
|
+ [FileStatusEnum::DELETION_REQUESTED->value, $workId]
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// Delete WorkByUser records
|
|
// Delete WorkByUser records
|
|
|
$this->connection->executeStatement(
|
|
$this->connection->executeStatement(
|
|
|
- "DELETE FROM work_by_user WHERE work_id = ?",
|
|
|
|
|
|
|
+ "DELETE FROM WorkByUser WHERE work_id = ?",
|
|
|
[$workId]
|
|
[$workId]
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// Delete the work itself
|
|
// Delete the work itself
|
|
|
$this->connection->executeStatement(
|
|
$this->connection->executeStatement(
|
|
|
- "DELETE FROM work WHERE id = ?",
|
|
|
|
|
|
|
+ "DELETE FROM Work WHERE id = ?",
|
|
|
[$workId]
|
|
[$workId]
|
|
|
);
|
|
);
|
|
|
|
|
|