MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / interval_cleaning

Method interval_cleaning

pywebio/platform/adaptor/http.py:204–216  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

202 context.set_header('Access-Control-Max-Age', str(1440 * 60))
203
204 def interval_cleaning(self):
205 # clean up at intervals
206 cls = type(self)
207 need_clean = False
208
209 if time.time() - cls._last_check_session_expire_ts > self.session_cleanup_interval:
210 with cls._webio_expire_lock:
211 if time.time() - cls._last_check_session_expire_ts > self.session_cleanup_interval:
212 cls._last_check_session_expire_ts = time.time()
213 need_clean = True
214
215 if need_clean:
216 cls._remove_expired_sessions(self.session_expire_seconds)
217
218 def handle_request(self, context: HttpContext):
219 try:

Callers 1

Calls 1

Tested by

no test coverage detected