{"id":18926801,"url":"https://github.com/ladjs/stop-agenda","last_synced_at":"2025-04-15T13:33:28.087Z","repository":{"id":25050421,"uuid":"103056154","full_name":"ladjs/stop-agenda","owner":"ladjs","description":"Gracefully stop Agenda and cancel recurring jobs","archived":false,"fork":false,"pushed_at":"2022-04-08T08:03:30.000Z","size":144,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-10T16:23:43.841Z","etag":null,"topics":["agenda","attempt","db","graceful","handle","handler","mongo","mongoose","reconnection","restart","start"],"latest_commit_sha":null,"homepage":"https://lad.js.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ladjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-10T19:33:48.000Z","updated_at":"2018-09-25T02:31:08.000Z","dependencies_parsed_at":"2022-08-07T11:15:15.974Z","dependency_job_id":null,"html_url":"https://github.com/ladjs/stop-agenda","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fstop-agenda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fstop-agenda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fstop-agenda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ladjs%2Fstop-agenda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ladjs","download_url":"https://codeload.github.com/ladjs/stop-agenda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223672916,"owners_count":17183618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agenda","attempt","db","graceful","handle","handler","mongo","mongoose","reconnection","restart","start"],"created_at":"2024-11-08T11:17:12.469Z","updated_at":"2024-11-08T11:17:13.100Z","avatar_url":"https://github.com/ladjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stop-agenda\n\n[![build status](https://img.shields.io/travis/ladjs/stop-agenda.svg)](https://travis-ci.org/ladjs/stop-agenda)\n[![code coverage](https://img.shields.io/codecov/c/github/ladjs/stop-agenda.svg)](https://codecov.io/gh/ladjs/stop-agenda)\n[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)\n[![license](https://img.shields.io/github/license/ladjs/stop-agenda.svg)](\u003c\u003e)\n\n\u003e Gracefully stop [Agenda][] and cancel recurring jobs\n\n\n## Table of Contents\n\n* [Install](#install)\n* [Usage](#usage)\n* [Options](#options)\n* [Contributors](#contributors)\n* [License](#license)\n\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install stop-agenda\n```\n\n[yarn][]:\n\n```sh\nyarn add stop-agenda\n```\n\n\n## Usage\n\nYou should probably be using [Lad's agenda][lad-agenda] directly instead of this package.\n\n\u003e With default options:\n\n```js\nconst stopAgenda = require('stop-agenda');\nconst Agenda = require('agenda');\n\nconst agenda = new Agenda();\n\nstopAgenda(agenda).then().catch(console.error);\n```\n\n\u003e With advanced options including custom cancel query `cancelQuery` and check interval in milliseconds `checkIntervalMs`:\n\n```js\nconst stopAgenda = require('stop-agenda');\nconst Agenda = require('agenda');\n\nconst agenda = new Agenda();\n\nstopAgenda(agenda, {\n  cancelQuery: {\n    repeatInterval: {\n      $exists: true,\n      $ne: null\n    }\n  },\n  checkIntervalMs: 300\n}).then().catch(console.error);\n```\n\n\n## Options\n\n\u003e `stopAgenda` accepts two arguments `(agenda, config)` and returns a `Promise`:\n\n* `agenda` (required) - a valid instance of [Agenda][]\n* `config` (optional) - a configuration object which defaults to:\n\n  ```js\n  {\n    cancelQuery: {\n      repeatInterval: {\n        $exists: true,\n        $ne: null\n      }\n    },\n    // (uses `process.env.STOP_AGENDA_CHECK_INTERVAL` if set)\n    checkIntervalMs: 500\n  }\n  ```\n\n\n## Contributors\n\n| Name           | Website                    |\n| -------------- | -------------------------- |\n| **Nick Baugh** | \u003chttp://niftylettuce.com/\u003e |\n\n\n## License\n\n[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)\n\n\n## \n\n[npm]: https://www.npmjs.com/\n\n[yarn]: https://yarnpkg.com/\n\n[agenda]: https://github.com/agenda/agenda\n\n[lad-agenda]: https://github.com/ladjs/agenda\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladjs%2Fstop-agenda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fladjs%2Fstop-agenda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladjs%2Fstop-agenda/lists"}