-
Notifications
You must be signed in to change notification settings - Fork 20
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
List all jobs and remove all jobs #83
base: main
Are you sure you want to change the base?
Conversation
I added
|
There isn't a way, at least there's no way to tell what type of job it is. This API wasn't really designed for managing jobs, just for kicking off tasks in the background that need to run every once in a while (and adding cron support for that). For things like uploading data or cleaning caches. Not really sure why I even included the To implement what you've mentioned probably requires a rather large refactor, or a completely new package. My recommendation is, unless you're using cron, just use the alarms API directly. |
In theory, we could pack the type and other information into the alarm ID, though I'm not sure how large those are allowed to be. And that would be a breaking change, so we'd have to document the upgrade process for removing the old jobs. Not saying we shouldn't do it, but I'd like to refactor things a bit as well if we're making breaking changes. |
Hey, I would like to use the Job scheduler, but it's a couple of functions from the API.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/alarms
I started to implement the getAll, but I wasn't sure how I should cast back Alarms to Job Types 🤔 . I would also like to add the
clearAll
function andclear
. Is it okay to return the Alarm object from these functions? Or should I just use the alarm API directly for these functions