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

Caching per_session not working #6168

Closed
MarcSkovMadsen opened this issue Jan 7, 2024 · 0 comments · Fixed by #6169
Closed

Caching per_session not working #6168

MarcSkovMadsen opened this issue Jan 7, 2024 · 0 comments · Fixed by #6169
Labels
type: bug Something isn't correct or isn't working
Milestone

Comments

@MarcSkovMadsen
Copy link
Collaborator

I'm on panel==1.3.6. I would like to cache per session. But I don't believe its working.

import panel as pn

pn.extension()

@pn.cache(per_session=True)
def get_data():
    print("running get_data")
    return "Some data"

pn.panel(get_data()).servable()

I would expect to get "running get_data" printed each time new session/ ServerConnection is created. But its not.

$ panel serve script.py --autoreload --index script.py
running get_data
2024-01-07 07:09:59,739 Starting Bokeh server version 3.3.2 (running on Tornado 6.3.3)
2024-01-07 07:09:59,741 User authentication hooks NOT provided (default user enabled)
2024-01-07 07:09:59,743 Bokeh app running at: http://localhost:5006/
2024-01-07 07:09:59,743 Bokeh app running at: http://localhost:5006/script
2024-01-07 07:09:59,743 Starting Bokeh server with process id: 31575
2024-01-07 07:10:01,916 WebSocket connection opened
2024-01-07 07:10:01,916 ServerConnection created
2024-01-07 07:10:11,724 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:11,910 WebSocket connection opened
2024-01-07 07:10:11,910 ServerConnection created
2024-01-07 07:10:12,850 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:13,019 WebSocket connection opened
2024-01-07 07:10:13,019 ServerConnection created
2024-01-07 07:10:13,829 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:14,132 WebSocket connection opened
2024-01-07 07:10:14,133 ServerConnection created
2024-01-07 07:10:14,621 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:14,785 WebSocket connection opened
2024-01-07 07:10:14,785 ServerConnection created
2024-01-07 07:10:15,324 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:15,504 WebSocket connection opened
2024-01-07 07:10:15,505 ServerConnection created
2024-01-07 07:10:15,990 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:16,203 WebSocket connection opened
2024-01-07 07:10:16,204 ServerConnection created
2024-01-07 07:10:16,638 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:16,796 WebSocket connection opened
2024-01-07 07:10:16,797 ServerConnection created
2024-01-07 07:10:17,326 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:17,679 WebSocket connection opened
2024-01-07 07:10:17,680 ServerConnection created
2024-01-07 07:10:17,971 WebSocket connection closed: code=None, reason=None
2024-01-07 07:10:18,152 WebSocket connection opened
2024-01-07 07:10:18,152 ServerConnection created
2024-01-07 07:10:31,463 WebSocket connection opened
2024-01-07 07:10:31,463 ServerConnection created
@MarcSkovMadsen MarcSkovMadsen added the type: bug Something isn't correct or isn't working label Jan 7, 2024
@MarcSkovMadsen MarcSkovMadsen added this to the v1.3.7 milestone Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant