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

Erorr while doing Keep alive #174

Open
bdbogjoe opened this issue Sep 28, 2022 · 2 comments
Open

Erorr while doing Keep alive #174

bdbogjoe opened this issue Sep 28, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bdbogjoe
Copy link

i'm trying to use keep alive but i have this error :

I'm running this is dedicated thread :
client.keep_alive().alive()

but i have this error after delay of 300s while doing real keep alive
self._client.post("Presence", 7)

2022-09-28 22:39:13,102 - pronotepy.pronoteAPI - INFO - Have you tried turning it off and on again? ERROR: 13 | La page a expiré ! (6)
Traceback (most recent call last):
  File "/home/eric/domotique/pronotepy/venv/lib/python3.10/site-packages/pronotepy/clients.py", line 765, in post
    return self.communication.post(function_name, post_data)
  File "/home/eric/domotique/pronotepy/venv/lib/python3.10/site-packages/pronotepy/pronoteAPI.py", line 187, in post

What is wrong in my code ?

@bain3
Copy link
Owner

bain3 commented Nov 15, 2022

Hi, sorry for the late reply.

What is wrong with my code?

Probably nothing. It looks like the page expired even though we tried to keep it alive with presence packets. Could you check how often your browser does a request to pronote when idle? Your instance could be set up differently with shorter delays...

@bain3 bain3 added the bug Something isn't working label Nov 15, 2022
bain3 added a commit that referenced this issue Nov 15, 2022
The web client sends a keep alive request every 2 minutes. To be
on the safe side, we can send it every 110 seconds.
@bain3
Copy link
Owner

bain3 commented Nov 15, 2022

Looking at the current demo website it does send something a bit different: appelpolling requests that look like an attempt at notifications maybe? I don't see any Presence requests anymore. Since there is always a pending request, it might have replaced the original system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants