MCPcopy
hub / github.com/FlareSolverr/FlareSolverr / get

Method get

src/sessions.py:74–81  ·  view source on GitHub ↗
(self, session_id: str, ttl: Optional[timedelta] = None)

Source from the content-addressed store, hash-verified

72 return True
73
74 def get(self, session_id: str, ttl: Optional[timedelta] = None) -> Tuple[Session, bool]:
75 session, fresh = self.create(session_id)
76
77 if ttl is not None and not fresh and session.lifetime() > ttl:
78 logging.debug(f'session\'s lifetime has expired, so the session is recreated (session_id={session_id})')
79 session, fresh = self.create(session_id, force_new=True)
80
81 return session, fresh
82
83 def session_ids(self) -> list[str]:
84 return list(self.sessions.keys())

Callers 15

flaresolverr.pyFile · 0.45
controller_v1Function · 0.45
TestFlareSolverrClass · 0.45
test_wrong_endpointMethod · 0.45
test_index_endpointMethod · 0.45
test_health_endpointMethod · 0.45
get_config_log_htmlFunction · 0.45
get_config_headlessFunction · 0.45
get_config_disable_mediaFunction · 0.45
get_webdriverFunction · 0.45
download_chromiumFunction · 0.45
TestFlareSolverrClass · 0.45

Calls 2

createMethod · 0.95
lifetimeMethod · 0.80

Tested by 3

test_wrong_endpointMethod · 0.36
test_index_endpointMethod · 0.36
test_health_endpointMethod · 0.36