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

Method retire

src/crawlee/sessions/_session.py:213–221  ·  view source on GitHub ↗

Retire the session by setting the error score to the maximum value. This method should be used if the session usage was unsuccessful and you are sure that it is because of the session configuration and not any external matters. For example when server returns 403 status code.

(self)

Source from the content-addressed store, hash-verified

211 self.retire()
212
213 def retire(self) -> None:
214 """Retire the session by setting the error score to the maximum value.
215
216 This method should be used if the session usage was unsuccessful and you are sure that it is because of
217 the session configuration and not any external matters. For example when server returns 403 status code.
218 If the session does not work due to some external factors as server error such as 5XX you probably want
219 to use `mark_bad` method.
220 """
221 self._error_score += self._max_error_score
222
223 def is_blocked_status_code(
224 self,

Callers 15

mark_goodMethod · 0.95
mark_badMethod · 0.95
__run_task_functionMethod · 0.80
test_retire_methodFunction · 0.80
handlerFunction · 0.80
handlerFunction · 0.80
handlerFunction · 0.80
default_handlerFunction · 0.80
default_handlerFunction · 0.80
mainFunction · 0.80
default_handlerFunction · 0.80

Calls

no outgoing calls

Tested by 5

test_retire_methodFunction · 0.64
handlerFunction · 0.64
handlerFunction · 0.64
handlerFunction · 0.64