Skip to content

#51 Submission Validation in a worker thread#197

Open
leoraba wants to merge 3 commits intocommit_submission_workerfrom
feat/validate_data_worker
Open

#51 Submission Validation in a worker thread#197
leoraba wants to merge 3 commits intocommit_submission_workerfrom
feat/validate_data_worker

Conversation

@leoraba
Copy link
Contributor

@leoraba leoraba commented Mar 11, 2026

Summary

This PR improves the performance of the submission data validation process.

Issues

Description of Changes

Worker threads

  • Implemented an execution of worker thread to perform submission data validation. (CPU intensive process running out of the main thread) to keep the main thread available.
  • Updating the Submission to OPEN status before running the worker thread in the following endpoints:
    • Add new data for a submission POST /submission/category/{categoryId}/data and POST /submission/category/{categoryId}/files
    • Delete submission data DELETE /submission/{submissionId}/{actionType}
    • Modify existing data for a submission PUT /submission/category/{categoryId}/data
    • Delete existing data for a submission DELETE /submission/category/{categoryId}/data/{systemId}

@leoraba leoraba changed the base branch from main to commit_submission_worker March 11, 2026 22:17
}): Promise<number> => {
const { submissionId, submissionData, username } = input;

const performDataValidation = async (submissionId: number): Promise<number> => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is being executed by the worker thread, changed the params to receive only the submissionId it will load submission data from db within the worker thread

workerpool.worker({
initializeWorker,
commitSubmission,
performDataValidation,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a function to the workerpool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant