mirror of
https://github.com/acaloiaro/neoq
synced 2026-07-21 10:12:18 +00:00
examples: Cleanup
This commit is contained in:
parent
6a368e05fc
commit
86955cb40c
2 changed files with 0 additions and 4 deletions
|
|
@ -41,7 +41,6 @@ func main() {
|
|||
log.Println("error listening to queue", err)
|
||||
}
|
||||
|
||||
// enqueue a job
|
||||
_, err = nq.Enqueue(ctx, &jobs.Job{
|
||||
Queue: queue,
|
||||
Payload: map[string]interface{}{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package main
|
|||
import (
|
||||
"context"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/acaloiaro/neoq"
|
||||
"github.com/acaloiaro/neoq/backends/postgres"
|
||||
|
|
@ -26,7 +25,6 @@ func main() {
|
|||
|
||||
h := handler.New(queue, func(ctx context.Context) (err error) {
|
||||
var j *jobs.Job
|
||||
time.Sleep(1 * time.Second)
|
||||
j, err = jobs.FromContext(ctx)
|
||||
log.Println("got job id:", j.ID, "messsage:", j.Payload["message"])
|
||||
done <- true
|
||||
|
|
@ -38,7 +36,6 @@ func main() {
|
|||
log.Println("error listening to queue", err)
|
||||
}
|
||||
|
||||
// Add a job that will execute 1 hour from now
|
||||
jobID, err := nq.Enqueue(ctx, &jobs.Job{
|
||||
Queue: queue,
|
||||
Payload: map[string]interface{}{
|
||||
|
|
|
|||
Loading…
Reference in a new issue