Skip to content
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

GET /classifier-jobs able to return overlapped jobs #626

Merged
merged 7 commits into from
Jun 6, 2024

Conversation

Tooseriuz
Copy link
Member

✅ DoD

(use na when API docs (Release notes, etc) do not need to be updated)

📝 Summary

  • Add param query_streams query_start query_end query_hours to GET /classifier-jobs endpoint

📸 Examples

example new params

{
   query_streams: 'site-A,site-B,site-C',
   query_start: '2024-01-01',
   query_end: '2024-01-10',
   query_hours: '10,15-20'
}

@Tooseriuz Tooseriuz self-assigned this May 30, 2024
@@ -42,6 +42,22 @@ const Converter = require('../../common/converter')
* description: Customize included fields and relations
* in: query
* type: array
* - name: query_streams
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we always use naming like:

       - name: streams
       - name: start
       - name: end

Copy link
Member Author

Choose a reason for hiding this comment

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

@veckatimest POST /classifier-jobs also using these query_streams, etc. so I think it's better to keep this naming.

Copy link
Contributor

@grindarius grindarius left a comment

Choose a reason for hiding this comment

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

The code looks good to me.


const hours = [startRange]
let nextHour = startRange
while (hours.at(-1) !== endRange) {
Copy link
Contributor

@veckatimest veckatimest Jun 5, 2024

Choose a reason for hiding this comment

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

let currentHour = startRange
const hours = [startRange]
while (currentHour !== endRange) {
  currentHour += 1
  if (currentHour === 24) {
    currentHour = 0
  }
  hours.push(currentHour)
}

maybe you'll enjoy this solution (without checking the last added hour in the array)

@Tooseriuz Tooseriuz merged commit fda5cd7 into develop Jun 6, 2024
3 checks passed
@Tooseriuz Tooseriuz deleted the feature/get-overlapped-job branch June 6, 2024 08:53
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.

Endpoint to return overlap processed job from input queries
3 participants