mirror of
https://github.com/netzbegruenung/green-spider.git
synced 2024-05-01 08:34:51 +02:00
Fixes for two problems found during spidering
This commit is contained in:
parent
fd4a29da8e
commit
323205a333
|
@ -19,7 +19,9 @@
|
|||
# secrets/datastore-writer.json
|
||||
|
||||
|
||||
DOCKERIMAGE="quay.io/netzbegruenung/green-spider:dev"
|
||||
DOCKERIMAGE="quay.io/netzbegruenung/green-spider:latest"
|
||||
|
||||
RESULTS_ENTITY_KIND="spider-results"
|
||||
|
||||
API_TOKEN_SECRET="secrets/hetzner-api-token.sh"
|
||||
test -f $API_TOKEN_SECRET || { echo >&2 "File $API_TOKEN_SECRET does not exist."; exit 1; }
|
||||
|
@ -161,7 +163,7 @@ else
|
|||
$DOCKERIMAGE \
|
||||
--credentials-path /secrets/datastore-writer.json \
|
||||
--loglevel info \
|
||||
spider --kind spider-results-dev
|
||||
spider --kind $RESULTS_ENTITY_KIND
|
||||
|
||||
fi
|
||||
|
||||
|
|
|
@ -21,14 +21,16 @@ class Rater(AbstractRater):
|
|||
found_pageloads = 0
|
||||
found_errors = 0
|
||||
for url in self.check_results['load_in_browser']:
|
||||
if self.check_results['load_in_browser'][url]['logs'] == []:
|
||||
if (self.check_results['load_in_browser'][url]['logs'] == [] or
|
||||
self.check_results['load_in_browser'][url]['logs'] is None):
|
||||
found_pageloads += 1
|
||||
continue
|
||||
|
||||
# scan log entries for script errors
|
||||
for entry in self.check_results['load_in_browser'][url]['logs']:
|
||||
if entry['source'] == 'javascript':
|
||||
found_errors += 1
|
||||
if self.check_results['load_in_browser'][url]['logs'] is not None:
|
||||
for entry in self.check_results['load_in_browser'][url]['logs']:
|
||||
if entry['source'] == 'javascript':
|
||||
found_errors += 1
|
||||
|
||||
if found_pageloads > 0 and found_errors == 0:
|
||||
value = True
|
||||
|
|
Loading…
Reference in a new issue