-
Notifications
You must be signed in to change notification settings - Fork 18
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
Implement concurrency mechanism #52
Conversation
…avoid duplicated requests
8a49555
to
d9f2b70
Compare
// Wait for last secret to be added to report | ||
time.Sleep(time.Millisecond * timeSleepInterval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @joaopedrocsilva , very nice work, I added this to my PR #53.
I have one question... why we are sleeping here? Why the waitGroup
is not helping us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @baruchiro.
Couln't understand why but without the sleep we can't get all elements.
Maybe it would make sense to spend some time investigating if it's realated to issues on goroutines management or it's related to some kind of limitations.
Resolves #31 ### Features - We expect the user to give us a *Personal Access Token*. This token can be retrieved from the browser *Dev Tool*, or by authenticating a *Discord App*. See #31 (comment). - The user must give at least one `--discord-server`, we will not loop over all the user's servers. - The *Server* in Discord called *Guild* in the API. - If the user doesn't give `--discord-channel`, we will scan all the channels in a server. - We will scan all messages until `--discord-duration` or `--discord-messages-count` (the closest one). - **Threads**: Only *bots* can get all the **threads** from a **channel**. As we currently use *Personal Access Token*, we can get the **thread** from the **message** started it. So we will scan the **threads** that *started* in the time/limit arguments (as they are messages that scanned), and for each **thread** we will scan the messages in the time/limit requirements. ### Questions - It is a little confusing if you give multiple **servers** and multiple **channels**, because each **channel** relates to its **server**, and also if you will give **channels** only for one **server**, the other **server** will not be scanned at all. Compared to *Confluence*, which has **servers** and **spaces**, we are not scanning multiple **servers** in one scan. Waits for #52
Implement suggested concurrency logic
Also added confluence window constant to avoid duplicated requests
Added a time.Sleep since without that the last item wasn't being added to the list of results