Skip to content

Queue System - #59

Open
musabgultekin wants to merge 6 commits into
masterfrom
queue
Open

musabgultekin wants to merge 6 commits into
masterfrom
queue

Conversation

@musabgultekin

Copy link
Copy Markdown
Collaborator

No description provided.

musabgultekin and others added 6 commits October 22, 2021 22:07
- Moves middleware logic to prior to goroutine (which blocks on rate limiter) allowing quick cancellation and avoids queues containing requests that will be cancelled.
- Extracts the delay middleware to execute separately within the goroutine
- Handles full queues by discarding URLs and logging a message
Queue performance enhancements + delay middleware fix
@musabgultekin

Copy link
Copy Markdown
Collaborator Author

@glaslos Its a bit old code but what do you think?

Comment thread geziyor.go
}

func (g *Geziyor) startWorkers() {
if g.Opt.ConcurrentRequests != 0 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If ConcurrentRequests would be 1 by default, you could removed the entire alternative logic section

Comment thread geziyor.go
func (g *Geziyor) startWorkers() {
if g.Opt.ConcurrentRequests != 0 {
for i := 0; i < g.Opt.ConcurrentRequests; i++ {
go func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd use a waitgroup for each go function so you can wait for them all to complete.

@melroy89

Copy link
Copy Markdown
Contributor

Any update @musabgultekin?

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.

4 participants