{"id":20986621,"url":"https://github.com/dpwgc/smallscheduler","last_synced_at":"2025-07-16T02:36:23.567Z","repository":{"id":210539349,"uuid":"726815853","full_name":"dpwgc/smallscheduler","owner":"dpwgc","description":"一个基于Go+MySQL的分布式任务调度平台","archived":false,"fork":false,"pushed_at":"2024-01-27T18:29:19.000Z","size":5174,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-28T13:07:14.651Z","etag":null,"topics":["cron","go","http","job","mysql","scheduler","server","task","vue"],"latest_commit_sha":null,"homepage":"https://gitee.com/dpwgc/smallscheduler","language":"Go","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/dpwgc.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-03T13:43:24.000Z","updated_at":"2024-01-28T13:07:14.652Z","dependencies_parsed_at":"2023-12-25T08:27:53.533Z","dependency_job_id":"79dfefea-3dca-4a77-b119-bc85ca1ad972","html_url":"https://github.com/dpwgc/smallscheduler","commit_stats":null,"previous_names":["dpwgc/smallscheduler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fsmallscheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fsmallscheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fsmallscheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dpwgc%2Fsmallscheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dpwgc","download_url":"https://codeload.github.com/dpwgc/smallscheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225304001,"owners_count":17453037,"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":["cron","go","http","job","mysql","scheduler","server","task","vue"],"created_at":"2024-11-19T06:14:22.609Z","updated_at":"2024-11-19T06:14:23.092Z","avatar_url":"https://github.com/dpwgc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Small Scheduler\n\n## 一个基于 Go + MySQL 的分布式定时任务调度平台\n\n### 特点\n\n* 无状态分布式服务，只依赖 `MySQL` 数据库，部署流程简单，通过乐观锁控制并发，确保同一时刻同一任务只会被一个服务实例执行\n* 使用HTTP Webhook触发任务，无代码侵入，支持`GET`、`POST`、`PUT`、`PATCH`、`DELETE`方法，支持自定义请求体与请求头\n* 自带网页控制台，可视化配置定时任务，支持设置调度失败重试规则（最大重试次数、重试间隔时间）及备用HTTP调度地址\n* 支持存储与查询各任务的调度记录，按年月划分，自动分表\n* 支持健康检查及平滑关闭服务\n\n![index](./image/index.png)\n![task](./image/task.png)\n![record](./image/record.png)\n\n***\n\n## 使用方式\n* 编辑项目配置文件 `config.yaml`，一般只用改数据库配置，其他配置默认即可\n* 运行 `main.go` 启动程序，默认http服务端口为9088\n* 访问网页控制台 http://localhost:9088/v1/web/\n* 在网页上配置与管理定时任务\n\n***\n\n## 编译并运行\n\n### 源代码编译\n\n```\ngo build main.go\n```\n\n#### 将编译后生成的可执行文件main与配置文件config.yaml、页面文件夹web放在同一目录下\n\n* 运行目录\n  * main\n  * config.yaml\n  * web\n    * css\n    * js\n    * index.html\n\n### Mac/Linux环境下运行\n\ncd 到运行目录，执行命令\n\n```\n./main\n```\n\n### Windows环境下运行\n\n双击`main.exe`运行程序\n\n***\n\n## 后台接口\n\n### 实例健康检查接口\n\n\u003e `GET` http://localhost:9088/v1/health\n\n* 正常情况：HTTP状态码返回`200`\n* 正在等待关闭服务：HTTP状态码返回`400`\n \n### 平滑关闭实例接口\n\n\u003e `GET` http://localhost:9088/v1/shutdown?wait=10\n\n* 该接口仅限本机调用（只能使用`localhost`、`127.0.0.1`、`0.0.0.0`这三个hostname访问）\n* 参数 `wait` : 等待关闭时间（单位-秒），必须大于0\n* 调用`shutdown`接口后，会在等待一段时间后关闭该实例，等待期间只会继续执行那些已经在执行过程中的任务，不会再加载新的任务（避免正在运行的任务突然被打断）","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpwgc%2Fsmallscheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdpwgc%2Fsmallscheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdpwgc%2Fsmallscheduler/lists"}