Skip to content

Conversation

garrrikkotua
Copy link
Contributor

@garrrikkotua garrrikkotua commented Nov 6, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at b5d4613

Increase the concurrency and add locking mechanisms for activity processing in the data sink and integration data workers. This will improve the efficiency and reliability of the services that handle activities from the data source.

🤖 Generated by Copilot at b5d4613

Oh, we're the jolly coders of the MAX_CONCURRENT_PROCESSING three
We pull and push the data from the source to the sea
We don't need no old functions that are lying in the dust
We use our custom locking with the mighty Redis trust

Why

How

🤖 Generated by Copilot at b5d4613

  • Add custom locking functions for concurrent processing of activities (link)
  • Comment out unused locking functions from @crowd/redis (link)
  • Increase the maximum number of activities that can be processed at the same time by the integration_data_worker service (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@@ -30,13 +32,13 @@ export const processOldResultsJob = async (

const loadNextBatch = async (): Promise<string[]> => {
return await processWithLock(redis, 'process-old-results', 5 * 60, 3 * 60, async () => {
const resultIds = await repo.getOldResultsToProcess(5)
const resultIds = await repo.getOldResultsToProcess(MAX_CONCURRENT_PROMISES)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would load like 10 at once and process them MAX_CONCURRENT_PROMISES at a time.

@garrrikkotua garrrikkotua merged commit adf86df into main Nov 9, 2023
@garrrikkotua garrrikkotua deleted the improve/optimize-data-workers branch November 9, 2023 15:44
sausage-todd pushed a commit that referenced this pull request Nov 9, 2023
Co-authored-by: Uroš Marolt <[email protected]>
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.

2 participants