Title: Implement CRON style job scheduling · Issue #1337 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: Implement CRON style job scheduling · Issue #1337 · python-telegram-bot/python-telegram-bot
X Title: Implement CRON style job scheduling · Issue #1337 · python-telegram-bot/python-telegram-bot
Description: Hi all! I'd like to contribute to this project. I think it would be much easier to work with CRON style job scheduling. Below I describe the idea and list few examples. If this suggestion can be approved and merged I can come up with som...
Open Graph Description: Hi all! I'd like to contribute to this project. I think it would be much easier to work with CRON style job scheduling. Below I describe the idea and list few examples. If this suggestion can be ap...
X Description: Hi all! I'd like to contribute to this project. I think it would be much easier to work with CRON style job scheduling. Below I describe the idea and list few examples. If this suggestion can b...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/1337
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement CRON style job scheduling","articleBody":"Hi all! I'd like to contribute to this project. I think it would be much easier to work with CRON style job scheduling. Below I describe the idea and list few examples. If this suggestion can be approved and merged I can come up with some integration plan.\r\n\r\n# Implementation details\r\n\r\n```python\r\ndef run_cron(self, callback, tab)\r\n```\r\n\r\nWhere `tab` is a `string` object representing a standard CRON tab entry.\r\n\r\nFunction `run_cron` would throw appropriate exception if `tab` object is not a string matching CRON tab entry (use regex validation)\r\n\r\nIn order to easily integrate it into current scheduler we need to know how much time is required to pass until next execution, then we just add it into the queue with appropriate delay, which itself can be computed using [croniter](https://github.com/taichino/croniter).\r\n\r\nFew examples below.\r\n\r\n# Examples\r\n\r\nRun callback_function everyday at 2:00 AM.\r\n\r\n```python\r\njob = j.run_cron(callback_function, '0 2 * * *')\r\n```\r\n\r\nRun callback_function twice per day, at 5:00 AM and at 5:00 PM\r\n\r\n```python\r\njob = j.run_cron(callback_function, '0 5,17 * * *')\r\n```\r\n\r\nRun callback_function every minute\r\n\r\n```python\r\njob = j.run_cron(callback_function, '* * * * *')\r\n```\r\n\r\nRun callback_function every Sunday at 5:00 PM ( note that Sunday is both `0` and `7` )\r\n\r\n```python\r\njob = j.run_cron(callback_function, '0 17 * * 0')\r\n```\r\n\r\nRun callback_function every 10 minutes\r\n\r\n```python\r\njob = j.run_cron(callback_function, '*/10 * * * *')\r\n```\r\n\r\nRun callback_function every minute but only in January, May and August\r\n\r\n```python\r\njob = j.run_cron(callback_function, '* * * 1,5,8 *')\r\n```\r\n\r\nRun callback_function every Friday and Sunday at 5:00 PM\r\n\r\n```python\r\njob = j.run_cron(callback_function, '0 17 * * 5,7')\r\n```\r\n","author":{"url":"https://github.com/marekyggdrasil","@type":"Person","name":"marekyggdrasil"},"datePublished":"2019-02-03T09:20:26Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/1337"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:09111694-3fcd-cd52-af5d-42ba844c3875 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95D0:110357:725936:95618E:6B02586F |
| html-safe-nonce | 4c63d7d036190a0700830451adc507017d9868c630526ef618c2f0809077d928 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUQwOjExMDM1Nzo3MjU5MzY6OTU2MThFOjZCMDI1ODZGIiwidmlzaXRvcl9pZCI6Ijg0MTM5OTg5Njc5ODA5NzIxNDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d6a7e2f59ec7be1ff84ff3b896a51554b603d5cc2ffe9f42ef0c601765ede480 |
| hovercard-subject-tag | issue:406069146 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/1337/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f91fe2f6f12a4ba2d52bf1d62cb470440a2e49d846975ddb1a87c8b8bb136441/python-telegram-bot/python-telegram-bot/issues/1337 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f91fe2f6f12a4ba2d52bf1d62cb470440a2e49d846975ddb1a87c8b8bb136441/python-telegram-bot/python-telegram-bot/issues/1337 |
| og:image:alt | Hi all! I'd like to contribute to this project. I think it would be much easier to work with CRON style job scheduling. Below I describe the idea and list few examples. If this suggestion can be ap... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | marekyggdrasil |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width