Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/honmaple/maple-scheduler
scheduler
https://github.com/honmaple/maple-scheduler
apscheduler flask scheduler vue
Last synced: 2 minutes ago
JSON representation
scheduler
- Host: GitHub
- URL: https://github.com/honmaple/maple-scheduler
- Owner: honmaple
- License: bsd-3-clause
- Created: 2016-12-15T09:33:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T02:06:11.000Z (about 6 years ago)
- Last Synced: 2024-11-05T10:27:23.322Z (about 2 months ago)
- Topics: apscheduler, flask, scheduler, vue
- Language: Python
- Homepage:
- Size: 76.2 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* mape-scheduler
[[https://docs.python.org/3/whatsnew/3.6.html][https://img.shields.io/badge/python-3.6-brightgreen.svg]]
[[LICENSE][https://img.shields.io/badge/license-BSD-blue.svg]]
[[https://raw.githubusercontent.com/honmaple/maple-scheduler/master/example.png]]
** Quickstart
#+BEGIN_SRC python
from flask import Flask
from sche import sche, apiapp = Flask(__name__)
app.config.from_object("config")
sche.init_app(app, start=True)
api.init_app(app)if __name__ == '__main__':
app.run()
#+END_SRC
** Configure
example:#+BEGIN_SRC python
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from pytz import timezoneAPSCHEDULER = {
'jobstores': {
'default': SQLAlchemyJobStore(url='sqlite:///test_scheduler.db')
},
'executors': {
'default': {
'type': 'threadpool',
'max_workers': 20
}
},
'job_defaults': {
'coalesce': False,
'max_instances': 3
},
'timezone': timezone('Asia/Shanghai'),
'funcs': "jobs"
}
#+END_SRC|--------------+--------------------------------------------|
| jobstores | apscheduler jobstores,default *None* |
| executors | apscheduler executors,default *None* |
| job_defaults | apscheduler job_defaults,default *None* |
| timezone | apscheduler timezone,default *UTC* |
| funcs | str or list, tasks where find,default *[]* |
|--------------+--------------------------------------------|
** Some Api
- */scheduler*
- GET:
get all jobs
- POST:
add a new job,the *func* is same as 'jobs:vvv'
- */scheduler/status*
- GET:
get scheduler status,include running,executors,job_defaults
- POST:
start scheduler.You can pass parameter *pause* (default: *False*)
#+BEGIN_EXAMPLE
# when pause in ['1',1,'true','True']
pause = True
#+END_EXAMPLE
- DELETE:
shutdown scheduler.You can pass parameter *wait* (default: *True*)
#+BEGIN_EXAMPLE
# when wait in ['0',0,'False','false']
wait = False
#+END_EXAMPLE
- */scheduler/*
- GET:
get a job with id.
- PUT:
modify a job with id.
- DELETE:
delete a job with id.
- */scheduler//pause*
- POST:
pause a job with id.
- */scheduler//resume*
- POST:
resume a job with id.
- */scheduler//execute*
- POST:
Executes a job with id right now.
** Example
#+BEGIN_SRC shell
python runserver
#+END_SRC