Skip to content

Commit

Permalink
fix function name
Browse files Browse the repository at this point in the history
  • Loading branch information
vector233 committed Jun 18, 2024
1 parent 8efe70e commit 1cd38cd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions os/gcron/gcron.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func Stop(name ...string) {
defaultCron.Stop(name...)
}

// GracefulStop Blocks and waits all current running jobs done.
func GracefulStop() {
defaultCron.GracefulStop()
// StopGracefully Blocks and waits all current running jobs done.
func StopGracefully() {
defaultCron.StopGracefully()
}
4 changes: 2 additions & 2 deletions os/gcron/gcron_cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ func (c *Cron) Stop(name ...string) {
}
}

// GracefulStop Blocks and waits all current running jobs done.
func (c *Cron) GracefulStop() {
// StopGracefully Blocks and waits all current running jobs done.
func (c *Cron) StopGracefully() {
c.status.Set(StatusStopped)
c.jobWaiter.Wait()
}
Expand Down
2 changes: 1 addition & 1 deletion os/gcron/gcron_z_example_1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ func ExampleCronGracefulShutdown() {
glog.Printf(ctx, "Signal received: %s, stopping cron", sig)

glog.Print(ctx, "Waiting for all cron jobs to complete...")
gcron.GracefulStop()
gcron.StopGracefully()
glog.Print(ctx, "All cron jobs completed")
}
2 changes: 1 addition & 1 deletion os/gcron/gcron_z_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func TestCron_JobWaiter(t *testing.T) {
glog.Printf(ctx, "Signal received: %s, stopping cron", sig)

glog.Print(ctx, "Waiting for all cron jobs to complete...")
gcron.GracefulStop()
gcron.StopGracefully()
glog.Print(ctx, "All cron jobs completed")
t.Assert(s1.Len(), 4)
t.Assert(s2.Len(), 2)
Expand Down

0 comments on commit 1cd38cd

Please sign in to comment.