Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async compatible StaticFilesPanel #1983

Merged
merged 9 commits into from
Aug 20, 2024

Conversation

salty-ivy
Copy link
Member

@salty-ivy salty-ivy commented Aug 6, 2024

Description

Uses signals for automatic instrumentation of StaticFilesPanel and trigger recording mechanis.
and 2 ContextVar one for storing staticfiles particular to that request context and another for to identify signal for each request context.

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

debug_toolbar/panels/staticfiles.py Outdated Show resolved Hide resolved
debug_toolbar/panels/staticfiles.py Outdated Show resolved Hide resolved
debug_toolbar/panels/staticfiles.py Outdated Show resolved Hide resolved
Copy link
Member

@tim-schilling tim-schilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this a lot!

@salty-ivy
Copy link
Member Author

salty-ivy commented Aug 14, 2024

I think it still need those integration type tests. on it.

@salty-ivy
Copy link
Member Author

I have added one new test that practically tests panel's async compatibility which it failed before. We can test the concurrent capabilities in integration testing.

@salty-ivy salty-ivy marked this pull request as ready for review August 19, 2024 15:31
Copy link
Member

@tim-schilling tim-schilling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I have minor changes I'd like to see.

debug_toolbar/panels/staticfiles.py Outdated Show resolved Hide resolved
tests/panels/test_staticfiles.py Outdated Show resolved Hide resolved
@tim-schilling tim-schilling merged commit 6fc5ce8 into django-commons:main Aug 20, 2024
25 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