Add cron job for removing expired stored objects

Introduced `RemoveExpiredStoredObjectCronJob` to automate the deletion of expired stored objects every 7 days. Enhanced associated tests and updated relevant interfaces and classes to support the new cron job functionality.
This commit is contained in:
2024-08-28 11:41:43 +02:00
parent c38f7c1179
commit 0db2652f08
10 changed files with 344 additions and 12 deletions

View File

@@ -39,7 +39,9 @@ interface StoredObjectManagerInterface
public function read(StoredObject|StoredObjectVersion $document): string;
/**
* Set the content of a StoredObject.
* Register the content of a new version for the StoredObject.
*
* The manager is also responsible for registering a version in the StoredObject, and return this version.
*
* @param StoredObject $document the document
* @param string $clearContent The content to store in clear
@@ -52,6 +54,11 @@ interface StoredObjectManagerInterface
public function write(StoredObject $document, string $clearContent, ?string $contentType = null): StoredObjectVersion;
/**
* Remove a version from the storage.
*
* This method is also responsible for removing the version from the StoredObject (using @see{StoredObject::removeVersion})
* in case of success.
*
* @throws StoredObjectManagerException
*/
public function delete(StoredObjectVersion $storedObjectVersion): void;