Skip to content

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

Closed
@eliasyishak

Description

@eliasyishak

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions