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

enhancement: Info Request #16

Open
PierreBrisorgueil opened this issue Mar 24, 2021 · 6 comments
Open

enhancement: Info Request #16

PierreBrisorgueil opened this issue Mar 24, 2021 · 6 comments

Comments

@PierreBrisorgueil
Copy link

PierreBrisorgueil commented Mar 24, 2021

Hey @ziflex ,

Sometimes we are billed per request on the hosting of an API;

it would be possible to have an option on the post / to retrieve the info in the process?

{ 
  data: ...
  info: ...
}

I have a quick look for PR .. I have to dig a little GO before 😅

It's my last step to align all my containers on your worker and trash my fork 🤞

@ziflex
Copy link
Member

ziflex commented Mar 26, 2021

Hey, not sure I understand what you want.
Could you elaborate more on that?

@PierreBrisorgueil
Copy link
Author

PierreBrisorgueil commented Mar 26, 2021

@ziflex, Yep, sorry for the lack of precision.

Some providers will charge per request to the worker, the number of requests and its execution time etc.

If we want to retrieve the information for each triggered scrap, we go to two requests per scrap ( POST / & GET /info )

My idea was to include a new parameter on the post request.

POST /

Query {
    text: String!
    params: Map<string, any>
    info: Boolean? 
}

and if boolean is true return something like

{ 
  data: post request content []
  info: get /info request content []
}

@ziflex
Copy link
Member

ziflex commented Mar 26, 2021

Hmm, I do not like the idea of putting payload from another endpoint.
What particular information are you interested in ? We could use response headers for that and set up the behavior on a worker launch.

@PierreBrisorgueil
Copy link
Author

Hmm, I understand, and you are right. All the information, the goal would be to have the scrap and information about its execution in a single request (ip / chrome / ferret).

Perhaps a more straightforward solution would be to add a route running the other two? something like POST / debug (This is what I wanted PR to separate the use-case well but too little knowledge of GO to do it)

@ziflex
Copy link
Member

ziflex commented Apr 1, 2021

We could add this information to response headers.

What exactly do you need from /info? Everything?

@PierreBrisorgueil
Copy link
Author

hey, yep 🙂
the idea is to get all necessary informations to debug

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

No branches or pull requests

2 participants