MCPcopy Create free account
hub / github.com/apify/crawlee-python / mark_bad

Method mark_bad

src/crawlee/sessions/_session.py:204–211  ·  view source on GitHub ↗

Mark the session as bad after an unsuccessful session usage.

(self)

Source from the content-addressed store, hash-verified

202 self.retire()
203
204 def mark_bad(self) -> None:
205 """Mark the session as bad after an unsuccessful session usage."""
206 self._error_score += 1
207 self._usage_count += 1
208
209 # Retire the session if it is not usable anymore
210 if not self.is_usable:
211 self.retire()
212
213 def retire(self) -> None:
214 """Retire the session by setting the error score to the maximum value.

Callers 15

_handle_request_errorMethod · 0.80
test_mark_badFunction · 0.80
test_multiple_marksFunction · 0.80
default_handlerFunction · 0.80
default_handlerFunction · 0.80
mainFunction · 0.80
default_handlerFunction · 0.80
default_handlerFunction · 0.80
default_handlerFunction · 0.80
default_handlerFunction · 0.80
default_handlerFunction · 0.80

Calls 1

retireMethod · 0.95

Tested by 3

test_mark_badFunction · 0.64
test_multiple_marksFunction · 0.64