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

Workflow status and Idle event support #54

Merged
merged 2 commits into from
May 30, 2024

Conversation

jessepeterson
Copy link
Member

Create support for handling various Idle events. Firstly, support workflows receiving an event callback when they configure themselves for receiving an Idle event. But more interestingly:

We now support a new event subscription called IdleNotStartedSince. This intent of this event is to kick-off workflows automatically that have not been started in a configurable amount of time for a given enrollment ID. In other words: regularly run workflows for enrollments that regularly check-in.

To support this we add two new capabilities to the engine. The first is the ability to attach arbitrary data (event context) to an event subscription. For the above new event this means you can include the amount of time, in seconds, since the workflow should have been last run on an enrollment. Secondly we've added the ability of the engine to store, update, and clear the last time an workflow has run for an enrollment. This enables us to be able to check that time stamp and calculate if need to run a workflow again.

Note: this PR has MySQL schema changes. Please see the schema.00001.sql file for modification to apply.

Copy link

@natewalck natewalck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking comment.

engine/storage/kv/event.go Show resolved Hide resolved
@jessepeterson jessepeterson merged commit 0f82f4d into micromdm:main May 30, 2024
9 checks passed
@jessepeterson jessepeterson deleted the wf-status-idle-events branch June 13, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants