24 lines
512 B
Go
24 lines
512 B
Go
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
import "time"
|
||
|
import "github.com/bamzi/jobrunner"
|
||
|
|
||
|
func main() {
|
||
|
jobrunner.Start() // optional: jobrunner.Start(pool int, concurrent int) (10, 1)
|
||
|
jobrunner.Schedule("@every 5s", ReminderEmails{})
|
||
|
time.Sleep(time.Second * 30)
|
||
|
}
|
||
|
|
||
|
// Job Specific Functions
|
||
|
type ReminderEmails struct {
|
||
|
// filtered
|
||
|
}
|
||
|
|
||
|
// ReminderEmails.Run() will get triggered automatically.
|
||
|
func (e ReminderEmails) Run() {
|
||
|
// Queries the DB
|
||
|
// Sends some email
|
||
|
fmt.Printf("Every 5 sec send reminder emails \n")
|
||
|
}
|