Skip to content

Commit

Permalink
[fix] typos / reported by @kianmeng in searx PR-3366
Browse files Browse the repository at this point in the history
[PR-3366] searx/searx#3366

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
  • Loading branch information
return42 authored and vincens2005 committed Jan 20, 2023
1 parent ae7f09c commit 806a07a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
23 changes: 10 additions & 13 deletions searx/search/checker/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,16 @@ def _timestamp():

def run():
try:
# use a Redis lock to make sure there is no checker running at the same time
# (this should not happen, this is a safety measure)
with get_redis_client().lock(REDIS_LOCK_KEY, blocking_timeout=60, timeout=3600):
logger.info('Starting checker')
result: CheckerOk = {'status': 'ok', 'engines': {}, 'timestamp': _timestamp()}
for name, processor in PROCESSORS.items():
logger.debug('Checking %s engine', name)
checker = Checker(processor)
checker.run()
if checker.test_results.successful:
result['engines'][name] = {'success': True}
else:
result['engines'][name] = {'success': False, 'errors': checker.test_results.errors}
logger.info('Starting checker')
result: CheckerOk = {'status': 'ok', 'engines': {}, 'timestamp': _timestamp()}
for name, processor in PROCESSORS.items():
logger.debug('Checking %s engine', name)
checker = Checker(processor)
checker.run()
if checker.test_results.successful:
result['engines'][name] = {'success': True}
else:
result['engines'][name] = {'success': False, 'errors': checker.test_results.errors}

_set_result(result)
logger.info('Check done')
Expand Down
12 changes: 3 additions & 9 deletions searx/search/processors/online.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,9 @@ def get_params(self, search_query, engine_category):
def _send_http_request(self, params):
# create dictionary which contain all
# information about the request
request_args = dict(headers=params['headers'], cookies=params['cookies'], auth=params['auth'])

# verify
# if not None, it overrides the verify value defined in the network.
# use False to accept any server certificate
# use a path to file to specify a server certificate
verify = params.get('verify')
if verify is not None:
request_args['verify'] = params['verify']
request_args = dict(
headers=params['headers'], cookies=params['cookies'], verify=params['verify'], auth=params['auth']
)

# max_redirects
max_redirects = params.get('max_redirects')
Expand Down
10 changes: 5 additions & 5 deletions searx/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ outgoing:
#
enabled_plugins:
# # these plugins are enabled if nothing is configured ..
- 'Hash plugin'
- 'Search on category select'
- 'Self Informations'
- 'Tracker URL remover'
- 'Ahmia blacklist' # activation depends on outgoing.using_tor_proxy
# - 'Hash plugin'
# - 'Search on category select'
# - 'Self Information'
# - 'Tracker URL remover'
# - 'Ahmia blacklist' # activation depends on outgoing.using_tor_proxy
# # these plugins are disabled if nothing is configured ..
# - 'Hostname replace' # see hostname_replace configuration below
- 'Open Access DOI rewrite'
Expand Down

0 comments on commit 806a07a

Please sign in to comment.