Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check if it is running when calling start() #54

Merged
merged 3 commits into from
Aug 10, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ func (c *Cron) Entries() []*Entry {
return c.entrySnapshot()
}

// Start the cron scheduler in its own go-routine.
// Start the cron scheduler in its own go-routine if it is not running, otherwize it does nothing.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Start the cron scheduler in its own go-routine, or no-op if already started.

func (c *Cron) Start() {
if c.running {
return
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method documentation says:

// Start the cron scheduler in its own go-routine.

But it's not what this code does, so docs would need to be updated if this change is to be merged.

c.running = true
go c.run()
}
Expand Down