Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
youngxhui authored Jun 15, 2022
1 parent 8aca6ed commit 8a862df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ![](https://raw.githubusercontent.com/bamzi/jobrunner/master/views/runclock.jpg) JobRunner

[![Go](https://github.com/youngxhui/jobrunner/actions/workflows/go.yml/badge.svg)](https://github.com/youngxhui/jobrunner/actions/workflows/go.yml)

JobRunner is framework for performing work asynchronously, outside of the request flow. It comes with cron to schedule and queue job functions for processing at specified time.

It includes a live monitoring of current schedule and state of active jobs that can be outputed as JSON or Html template.
Expand Down
10 changes: 5 additions & 5 deletions runjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ func Schedule(spec string, job cron.Job, n ...string) error {
if err != nil {
return err
}
MainCron.Schedule(sched, New(job, ...n))
MainCron.Schedule(sched, New(job, n...))
return nil
}

// Run the given job at a fixed interval.
// The interval provided is the time between the job ending and the job being run again.
// The time that the job takes to run is not included in the interval.
func Every(duration time.Duration, job cron.Job) {
func Every(duration time.Duration, job cron.Job, n ...string) {

MainCron.Schedule(cron.Every(duration), New(job))
MainCron.Schedule(cron.Every(duration), New(job, n...))
}

// Run the given job right now.
func Now(job cron.Job, n ...string) {
go New(job, n).Run()
func Now(job cron.Job) {
go New(job).Run()
}

// Run the given job once, after the given delay.
Expand Down

0 comments on commit 8a862df

Please sign in to comment.