MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / start_periodic_refresh

Function start_periodic_refresh

browser_utils/cookie_refresh.py:179–197  ·  view source on GitHub ↗

Start the periodic cookie refresh background task. Returns: The created asyncio task, or None if refresh is disabled.

()

Source from the content-addressed store, hash-verified

177
178
179def start_periodic_refresh() -> Optional[asyncio.Task]:
180 """
181 Start the periodic cookie refresh background task.
182
183 Returns:
184 The created asyncio task, or None if refresh is disabled.
185 """
186 global _periodic_task
187
188 if not COOKIE_REFRESH_ENABLED:
189 logger.info("Cookie refresh is disabled, not starting periodic task")
190 return None
191
192 if _periodic_task is not None and not _periodic_task.done():
193 logger.warning("Periodic refresh task already running")
194 return _periodic_task
195
196 _periodic_task = asyncio.create_task(_periodic_refresh_loop())
197 return _periodic_task
198
199
200async def stop_periodic_refresh():

Callers 1

lifespanFunction · 0.90

Calls 3

_periodic_refresh_loopFunction · 0.85
infoMethod · 0.80
warningMethod · 0.80

Tested by

no test coverage detected