-
Couldn't load subscription status.
- Fork 32
EM-6870 add mimetype update task #2920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
b1781c7 to
457e0ca
Compare
|
Hi @mdayican ,
|
fixed. |
|
|
||
| private final DocumentContentVersionRepository documentContentVersionRepository; | ||
| private final StoredDocumentRepository storedDocumentRepository; | ||
| private final MimeTypeDetectionService mimeTypeDetectionService; // New dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This java comment can be removed
| public DocumentContentVersionService(DocumentContentVersionRepository documentContentVersionRepository, | ||
| StoredDocumentRepository storedDocumentRepository) { | ||
| StoredDocumentRepository storedDocumentRepository, | ||
| MimeTypeDetectionService mimeTypeDetectionService) { // Injected here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This java comment can be removed
|
|
||
| log.info("Iteration {}: Found {} records to process for MIME type update.", iteration, documentIds.size()); | ||
|
|
||
| ExecutorService executorService = Executors.newFixedThreadPool(threadLimit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can update in batch as well similar to
Line 100 in 6b9cd5d
| int batchCommitSize = 500; // Define the batch size for committing to the DB |
| log.info("Detected MIME type for {} as: {}", documentVersionId, mimeType); | ||
| return mimeType; | ||
|
|
||
| } catch (IOException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing a unit test for this catch block
EM-6870 add mimetype update task