Giter Site home page Giter Site logo

cronjob's Introduction

CronJob

本项目采用FastAPI + APScheduler + ZeroRPC开发轻量级定时调度平台

特点

  • 完全兼容Crontab
  • 支持秒级定时任务
  • 作业任务可搜索、暂停、编辑、删除
  • 作业任务持久化存储、三种不同触发器类型作业动态添加
  • 采用RPC方式规避了APScheduler在多进程部署的情况下,任务被多次调度的问题
  • 提供图形化的管理页面

TODO

使用

  • 安装虚拟环境管理器
pip install pipenv
  • 获取代码并激活虚拟环境
git clone https://github.com/AnsGoo/cronJob.git
pipenv shell
  • 安装依赖
pipenv sync
  • 运行
// 开发
pipenv run dev --host=0.0.0.0 --port=8000 --reload
pipenv run rpc

// 生产

pipenv run server--workers=4 --host=0.0.0.0 --port=8000
pipenv run rpc
  • 部署

制作镜像

docker build cronjob:v1 .

运行

docker run -p 8000:8000 -p 4242:4242 --name cronjob -it cronjob:v1
  • 开发任务

job/tasks.pyTask对象中自定义以task开头的任务即可在调度方法中调取该任务,例如:

class Task(BaseTask):
    def task_test(self) -> None:
        '''
        测试任务
        :return:
        '''
        print('test')

License

This project is licensed under the terms of the MIT license.

cronjob's People

Contributors

ansgoo avatar xingxingzaixian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cronjob's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.