Stop the periodic cookie refresh background task.
()
| 198 | |
| 199 | |
| 200 | async def stop_periodic_refresh(): |
| 201 | """ |
| 202 | Stop the periodic cookie refresh background task. |
| 203 | """ |
| 204 | global _periodic_task |
| 205 | |
| 206 | if _periodic_task is not None and not _periodic_task.done(): |
| 207 | _periodic_task.cancel() |
| 208 | try: |
| 209 | await _periodic_task |
| 210 | except asyncio.CancelledError: |
| 211 | pass |
| 212 | _periodic_task = None |
| 213 | logger.info("🔄 Periodic cookie refresh stopped") |
| 214 | |
| 215 | |
| 216 | def get_refresh_stats() -> dict: |