Skip to content

Refactor AddScraperJobs to streamline job processing and improve erro…#66

Merged
lalalaurentiu merged 1 commit intopeviitor-ro:mainfrom
lalalaurentiu:validator
Nov 27, 2025
Merged

Refactor AddScraperJobs to streamline job processing and improve erro…#66
lalalaurentiu merged 1 commit intopeviitor-ro:mainfrom
lalalaurentiu:validator

Conversation

@lalalaurentiu
Copy link
Collaborator

This pull request refactors the AddScraperJobs API endpoint to streamline how companies and jobs are created and associated, and removes unnecessary exception handling. The main focus is on ensuring that only one company is created per batch of jobs, improving data integrity and reducing redundant operations.

Refactoring and logic improvements:

  • Only a single Company instance is created for all jobs in the request, using the first job's company and source information, instead of creating a new company for each job.
  • The company is now added to the user only once, after creation, rather than potentially multiple times.

Error handling and code cleanup:

  • Removed the broad try/except block, allowing exceptions to propagate and improving error visibility and debugging.
  • Cleaned up indentation and removed redundant code, making the method easier to read and maintain.

Data consistency:

  • The jobs count for the company is now calculated after all jobs are posted, ensuring the DataSet reflects the correct number of jobs.…r handling

@lalalaurentiu lalalaurentiu merged commit 76ba6da into peviitor-ro:main Nov 27, 2025
6 checks passed
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