[Attachment] Data services does not clean up attachments which are not referenced by any docRef

Hi, I thought cleanUpDirtyAttachmentsJob will handle job to clean up files in the attachment storage location which are not referenced by any GenericReference. When I test with my local, the attachment without any reference is not deleted after cleanUpDirtyAttachmentsJob run every 5 minutes.

Am I missing any configuration or misunderstanding the documentation ? Thank you in advance.

Hello @anh-low-matrix,

I have a quick check, this is a code snippet from #ServiceFactoryConfiguration.java DS 36.3.10

@Conditional({ OnEnabledAttachmentCondition.class, OnEnabledFileSystemWriteCondition.class, OnEnabledJobCondition.class })
@Bean public JobDetail cleanUpDirtyAttachmentsJobDetail() {
		return JobBuilder.newJob()
			.ofType(CleanUpDirtyAttachmentsJob.class)
			.withIdentity("cleanUpDirtyAttachmentsJob", ATTACHMENTS)
			.withDescription("Clean up dirty attachments job.")
			.storeDurably()
			.build();
	}

Could you please check if your project configuration can enable this bean?

Hi Luu, thanks for your support. I debug and find solution for my issue.

Hello @anh-low-matrix , I am a member of the Discourse team. I can see that there was a new response to your question*. Do you find it helpful or should the question remain open? If not please mark it as solved.

Thanks ahead for your feedback and have a nice rest of the day!