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

Implement concurrency mechanism #52

Merged
merged 6 commits into from
Apr 26, 2023
Merged

Implement concurrency mechanism #52

merged 6 commits into from
Apr 26, 2023

Conversation

joaopedrocsilva
Copy link
Contributor

@joaopedrocsilva joaopedrocsilva commented Apr 19, 2023

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

@joaopedrocsilva joaopedrocsilva self-assigned this Apr 19, 2023
@github-actions
Copy link

github-actions bot commented Apr 19, 2023

kics-logo

KICS version: v1.6.13

Category Results
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 1
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 1
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 49
Queries failed to execute placeholder 0
Execution time placeholder 2

@baruchiro baruchiro mentioned this pull request Apr 20, 2023
@jossef jossef merged commit 487596f into master Apr 26, 2023
@jossef jossef deleted the joaocs/conc branch April 26, 2023 17:06
Comment on lines +152 to +153
// Wait for last secret to be added to report
time.Sleep(time.Millisecond * timeSleepInterval)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

jossef pushed a commit that referenced this pull request May 11, 2023
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
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