Skip to content

find url and retri for multiple sps by client address#16

Merged
CodeWarriorr merged 3 commits intomainfrom
feature/find-url-and-retri-for-multi-sps-by-client
Jul 14, 2025
Merged

find url and retri for multiple sps by client address#16
CodeWarriorr merged 3 commits intomainfrom
feature/find-url-and-retri-for-multi-sps-by-client

Conversation

@CodeWarriorr
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for fetching URLs and retrievability metrics by client address, enhances the job model to record multiple provider results, and refactors job handling to emit and store those results.

  • Introduce a new /url/client/:client route and handler for client-based lookups.
  • Extend the Job struct and repository to accumulate multiple ProviderResult entries.
  • Refactor job_handler to return, log, and persist multiple success/error outcomes.

Reviewed Changes

Copilot reviewed 12 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/routes.rs Added a route for handle_find_client
src/repository/job_repo.rs Changed Job to hold results: Vec<ProviderResult> and updated methods (add_success_result, add_error_result, set_status)
src/lotus_rpc.rs Inserted a debug log for peer ID requests
src/deal_service.rs Introduced get_distinct_providers_by_client
src/deal_repo.rs Implemented get_distinct_providers_by_client SQL query
src/background/job_handler.rs Refactored to use JobHandlerResult enum with detailed result structs and handle multiple results
src/api/responses.rs Added new ErrorCode variants (NoProviderOrClient, NoProvidersFound)
src/api/get_job.rs Populates working_url and retrievability from first results element for FE compatibility
src/api/find_client.rs New handler handle_find_client for client-based URL retrieval
src/api/create_job.rs Made provider optional, improved validation, and updated docs
src/api/api_doc.rs Updated API documentation to include the new client endpoint
Files not reviewed (3)
  • .sqlx/query-072675ef78b55b473101ad5e556529177403872c30a9f1f95829fcfe03a3cc68.json: Language not supported
  • .sqlx/query-7ef60661a9826e8e3e00158e7d018c465227cff3b07498d8793f310cf78135ef.json: Language not supported
  • .sqlx/query-e130ef133dc7185f8dc726e7a08b14a1d39191f9c64ec351eeec3683a808228b.json: Language not supported

@CodeWarriorr CodeWarriorr merged commit e37e2a3 into main Jul 14, 2025
5 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.

3 participants