Conversation
| realLinks[i] = lnk.RealLink | ||
| } | ||
| availabilities, err := getLinksAvailability(realLinks) | ||
|
|
| urlsConcurrency = 4 | ||
| ) | ||
|
|
||
| func getLinksAvailability(urls []string) ([]bool, error) { |
There was a problem hiding this comment.
So, you are making some pipeline running on API call?
And you are handling OS signal from the context of API call handler? Am I right?
Why do you do this in the context of user request in the first place? It could be done completely independently.
There was a problem hiding this comment.
I'll try to clarify my point. It is very disturbing to see OS signal handling at a random place. What are you trying to achieve here? Will somebody send a signal to cancel exactly this API call? Will you add signal handling in each of API calls?
If you want to have a possibility to turn down pipeline use more idiomatic and clean way. Place OS signals handling near the entry point of you program and use context package to propagate signals.
There was a problem hiding this comment.
ok, i create context for api and move signal handling here
No description provided.