Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

An useless thread is created on each request in the general category #903

Closed
dalf opened this issue Apr 20, 2017 · 1 comment
Closed

An useless thread is created on each request in the general category #903

dalf opened this issue Apr 20, 2017 · 1 comment
Labels
Projects

Comments

@dalf
Copy link
Contributor

dalf commented Apr 20, 2017

The commit 01e2648 introduces a regression :

  • before this commit, the request function was calls then if an url was requested a thread was created
  • with this commit a thread is created for each engine

It's not an issue except for one engine in the general category: currency.

Most of the time the currency engine doesn't send a request, but a thread is still created (which take time)

The call to the request function in the main thread is also a problem since some engine sends an HTTP request (wolframalpha for example).

A better solution would be a function can_accept defined inside the engine ? (similar to the PR #797)

Edit : the PR #853 could be implemented as an engine too.

@dalf dalf added the core label Apr 20, 2017
@dalf dalf changed the title Useless thread create on each request in the general category An useless thread created on each request in the general category Apr 20, 2017
@dalf dalf changed the title An useless thread created on each request in the general category An useless thread is created on each request in the general category Apr 20, 2017
@ghost ghost mentioned this issue Apr 20, 2017
dalf added a commit to dalf/searx that referenced this issue Aug 12, 2017
… calls this function creating a thread for the engine.
dalf added a commit to dalf/searx that referenced this issue Aug 19, 2017
… calls this function creating a thread for the engine.
@asciimoo asciimoo added this to Milestone #2 - Backend in v1.0.0 Mar 9, 2020
@kvch
Copy link
Member

kvch commented Oct 8, 2020

Closing the issue as @dalf is refactoring the request/response mechanism in searx. It will be asynchronous, so threads will be gone.

@kvch kvch closed this as completed Oct 8, 2020
v1.0.0 automation moved this from Milestone #2 - Backend to Done Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
v1.0.0
  
Done
2 participants