Skip to content

fix: Replace lifespan context manager with startup event handler#130

Merged
tisnik merged 1 commit into
lightspeed-core:mainfrom
eranco74:async
Jun 25, 2025
Merged

fix: Replace lifespan context manager with startup event handler#130
tisnik merged 1 commit into
lightspeed-core:mainfrom
eranco74:async

Conversation

@eranco74
Copy link
Copy Markdown
Contributor

Description

  • Remove asynccontextmanager lifespan implementation
  • Use @app.on_event('startup') decorator instead
  • Resolves RuntimeError: asyncio.run() cannot be called from a running event loop
  • Maintains same startup functionality with compatible async context

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

- Remove asynccontextmanager lifespan implementation
- Use @app.on_event('startup') decorator instead
- Resolves RuntimeError: asyncio.run() cannot be called from a running event loop
- Maintains same startup functionality with compatible async context
@tisnik tisnik merged commit 12f7baa into lightspeed-core:main Jun 25, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants