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

Refactor analytics session handler to use File.lastModifiedSync for _lastPing #240

Closed
eliasyishak opened this issue Feb 28, 2024 · 0 comments

Comments

@eliasyishak
Copy link
Contributor

Instead of repeatedly reading the json file to get the last ping value, we should instead refactor that class so that it uses the session json file's last modified timestamp as the _lastPing value. When we fetch the session id, we should set the last modified timestamp on the file and only store the session id as a string by itself. This would also remove the overhead of having to parse the json every time we send an event.

We will write the the new session id if we find that we need to update it since 30 minutes have passed since the last ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant