Skip to content
This repository was archived by the owner on Feb 19, 2026. It is now read-only.

Update plugin for job queues - #2

Merged
mariusandra merged 7 commits into
mainfrom
jobs
May 23, 2021
Merged

Update plugin for job queues#2
mariusandra merged 7 commits into
mainfrom
jobs

Conversation

@mariusandra

@mariusandra mariusandra commented May 6, 2021

Copy link
Copy Markdown
Contributor

When 1.25 lands.

Closes #1

@mariusandra
mariusandra marked this pull request as draft May 6, 2021 09:13
@mariusandra

Copy link
Copy Markdown
Contributor Author

TODO: needs session_duration and possibly the event names to be reverted to the old style?

@mariusandra

Copy link
Copy Markdown
Contributor Author

I just realised one thing. While this will definitely work most of the time, it definitely won't work when we're processing a backlog of a few hours. From the perspective of this plugin, that relies on scheduled jobs ("run this in 30min") and expiring redis keys, this will get be tricky.

The solution to this is to somehow add a session id into the cache key, and then a if (first tiem) { send event } else { check time between events and send end if needed } but I'm not yet exactly sure how.

Related: events with custom timestamps entered by the user (3 events in a row: t + 1 hour, t - 1day, t, t + 30min) will also cause issues.

@mariusandra

Copy link
Copy Markdown
Contributor Author

Tested, works, merging.
The only problem is that this still expects to receive events in real time, so you'll get faulty sessions if batch processing a lot of things at the same time.

@mariusandra
mariusandra marked this pull request as ready for review May 23, 2021 07:25
@mariusandra
mariusandra merged commit 803ec96 into main May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a scheduled task to end open sessions

1 participant