gocron
by
go-co-op

Description: Easy and fluent Go cron scheduling. This is a fork from https://github.com/jasonlvhit/gocron

View on GitHub ↗

Summary Information

Updated 2 hours ago
Added to GitGenius on March 25th, 2023
Created on March 20th, 2020
Open Issues & Pull Requests: 1 (+0)
Number of forks: 343
Total Stargazers: 7,096 (+0)
Total Subscribers: 34 (+0)

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (50)
  • enhancement (35)
  • question (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: N/A
Mean response time: 15.9 days
90th percentile: 0.0 hours
Tracked items: 91

Most active contributors

Detailed Description

gocron is a Go job scheduling package that enables developers to run Go functions at predetermined intervals with a fluent, easy-to-use API. The project is a fork of the original jasonlvhit/gocron repository and has evolved into a comprehensive scheduling solution maintained by the go-co-op organization. The package supports multiple job scheduling paradigms including duration-based intervals, random durations, cron expressions, and calendar-based scheduling for daily, weekly, and monthly recurrence patterns. Jobs can also be scheduled as one-time executions at specific times.

The scheduler architecture separates concerns into three core components: Job objects that encapsulate tasks and their parameters, a Scheduler that tracks all jobs and determines execution timing, and an Executor that handles the actual invocation of job tasks while managing complex execution requirements. This design enables flexible scheduling behavior through different interval timing modes, where jobs can calculate their next run time either from their scheduled start time for predictable cron-like behavior or from completion time for scenarios requiring consistent rest periods between executions, such as rate-limited API calls or resource-intensive operations.

Concurrency management is a significant feature of gocron, offering both per-job and scheduler-wide limiting capabilities. Jobs can operate in singleton mode to either skip overlapping executions or queue them for sequential processing. The scheduler itself can limit the total number of concurrent jobs across all tasks, with both reschedule and queue strategies available. For distributed deployments, gocron supports running multiple instances through elector and locker abstractions, allowing leader election patterns and per-job locking across instances. The project maintains separate repositories for different elector and locker implementations within the go-co-op organization.

The package provides comprehensive observability through event listeners that can trigger actions based on job lifecycle events, a logging interface compatible with various logging libraries, and a metrics collection system. The metrics system includes a Monitor interface for job execution metrics, a MonitorStatus interface for status and error tracking, and a SchedulerMonitor interface providing detailed scheduler and job lifecycle events. Available metrics track scheduler lifecycle events, job management, job execution flow, performance measurements including execution time and scheduling delay, and concurrency constraint violations.

Testing support is built into gocron through provided mocks using gomock and the ability to inject a FakeClock for time mocking, enabling deterministic testing of scheduled jobs. The package offers extensive configuration through job-level options, global job options applied to all jobs in a scheduler, and scheduler-level options.

According to GitGenius activity tracking, the repository has processed 91 issues and pull requests with a median response latency of 0.0 hours and a mean of 382.3 hours, indicating rapid initial triage followed by variable resolution times. Bug reports comprise the majority of tracked issues at 50 items, with 35 enhancement requests and 1 question. JohnRoesler is the most active contributor with 199 tracked events, followed by pcfreak30 with 15 events and wandering-tales with 12 events. The repository shares contributors with major projects including rust-lang/rust, ant-design/ant-design, and golang/go. A companion project, gocron-ui, provides a web dashboard for monitoring and managing gocron jobs in real time.

gocron
by
go-co-opgo-co-op/gocron

Repository Details

Fetching additional details & charts...