{"id":24583473,"url":"https://github.com/itmisx/timer-schedule","last_synced_at":"2025-03-17T17:14:31.795Z","repository":{"id":179489191,"uuid":"663407213","full_name":"itmisx/timer-schedule","owner":"itmisx","description":"微服务下的定时调度系统，支持任务失败重试，调度丢失补偿","archived":false,"fork":false,"pushed_at":"2023-07-08T05:40:25.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T04:46:35.173Z","etag":null,"topics":["cronjob","microservice"],"latest_commit_sha":null,"homepage":"","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/itmisx.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-07T08:13:49.000Z","updated_at":"2024-07-31T06:21:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"eea5480d-e5e3-4946-986b-89c0d686bf80","html_url":"https://github.com/itmisx/timer-schedule","commit_stats":null,"previous_names":["itmisx/timer-schedule"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itmisx%2Ftimer-schedule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itmisx%2Ftimer-schedule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itmisx%2Ftimer-schedule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itmisx%2Ftimer-schedule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itmisx","download_url":"https://codeload.github.com/itmisx/timer-schedule/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075636,"owners_count":20393979,"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":["cronjob","microservice"],"created_at":"2025-01-24T04:46:42.095Z","updated_at":"2025-03-17T17:14:31.771Z","avatar_url":"https://github.com/itmisx.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timer-schedule\n\n\u003e 分布式定时任务调度系统\n\n#### 🚀️ 特性\n\n- 定时任务自定义\n- 按微服务分组管理\n- 避免微服务重复调用\n- 支持任务失败重试\n- 支持调度丢失补偿\n\n#### 🚀️ 快速开始\n\n- 准备docker环境\n- 拉取代码, `git clone https://github.com/itmisx/timer-schedule.git`\n- 进入项目目录，`cd timer-schedule`\n- 编译，`go build -o build/timer-schedule main.go`\n- 打包镜像，`docker build  -t itmisx:timer-schedule . `\n- 运行， `docker run -d itmisx:timer-schedule`\n\n#### 🚀️ 配置说明\n\n- redis，redis数据库配置\n- redis_prefix, redis key的前缀\n- max_timer_task, 每个定时任务的最大数量，自动移除旧的\n- 定时器配置,\n  - name, 定时器名称\n  - group，定时器系统分组\n  - spec，cron配置\n  - enable_retry，启用失败重试\n  - max_retry_times, 最大重试次数\n  - retry_delay，检查任务失败的延迟\n\n#### 🚀️ 客户端\n\n- 安装\n  `go get -u -v github.com/itmisx/timer-schedule`\n- 使用\n  ```go\n  // 创建定时任务消费客户端\n  // 参数1，redis前缀\n  // 参数2，系统分组\n  // 参数3，redis实例\n  timerConsumer:=pkg.New(\"timer-schedule:\",\"admin\",redis.NewDB())\n  // 添加指定任务的处理函数\n  timerConsumer.AddFunc(\"timerName1\",fn)\n  // 启动\n  timerConsumer.Start()\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitmisx%2Ftimer-schedule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitmisx%2Ftimer-schedule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitmisx%2Ftimer-schedule/lists"}