cancel
Showing results for 
Search instead for 
Did you mean: 

How to prevent garbage collection of binaries

Varun_Singh
Champ in-the-making
Champ in-the-making

We have a requirement that when all document records referencing a binary are deleted, the binary should still be preserved. However, according to Nuxeo documentation, Garbage Collection will remove these binaries. So my questions are:

  • Is garbage collection run as a scheduled background job? If so, which background work does that. I browsed through Nuxeo's source-code but couldn't find it
  • I checked the source-code of DocumentBlobManagerComponent which implements garbageCollectBinaries(boolean delete). There is an option to call garbageCollectBinaries(false) to prevent deletion but I couldn't find a contribution to override this. Can this be done without modifying the source code?
  • I couldn't find the usage of garbargeCollectBinaries function. It is not being called from anywhere except SQLRepositoryStatus.java. Do we need to call it manually? If so, just not calling it may solve my problem.

Thanks for the help in advance

2 REPLIES 2

Rodri_
Star Contributor
Star Contributor

I am not 100% sure, but I think garbage collection is not scheduled in background, at least in default mode. If you want to remove orphaned binaries, you have to execute the script provided by nuxeo manually, or you can create your own process.

Varun_Singh
Champ in-the-making
Champ in-the-making

Thanks Rodri. That's what it seems at least from the codebase.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.