diff --git a/README.md b/README.md index a17d5adf..0b859a26 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ To enqueue jobs, you need to make an Enqueuer with a redis namespace and a redig package main import ( - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" "github.com/gocraft/work" ) @@ -56,7 +56,7 @@ In order to process jobs, you'll need to make a WorkerPool. Add middleware and j package main import ( - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" "github.com/gocraft/work" "os" "os/signal" @@ -246,11 +246,11 @@ You'll see a view that looks like this: ### Processing a job * To process a job, a worker will execute a Lua script to atomically move a job its queue to an in-progress queue. - * A job is dequeued and moved to in-progress if the job queue is not paused and the number of active jobs does not exceed concurrency limit for the job type + * A job is dequeued and moved to in-progress if the job queue is not paused and the number of active jobs does not exceed concurrency limit for the job type * The worker will then run the job and increment the job lock. The job will either finish successfully or result in an error or panic. * If the process completely crashes, the reaper will eventually find it in its in-progress queue and requeue it. * If the job is successful, we'll simply remove the job from the in-progress queue. -* If the job returns an error or panic, we'll see how many retries a job has left. If it doesn't have any, we'll move it to the dead queue. If it has retries left, we'll consume a retry and add the job to the retry queue. +* If the job returns an error or panic, we'll see how many retries a job has left. If it doesn't have any, we'll move it to the dead queue. If it has retries left, we'll consume a retry and add the job to the retry queue. ### Workers and WorkerPools diff --git a/benches/bench_goworker/main.go b/benches/bench_goworker/main.go index cfc8243a..e254d6f1 100644 --- a/benches/bench_goworker/main.go +++ b/benches/bench_goworker/main.go @@ -2,12 +2,13 @@ package main import ( "fmt" - "github.com/benmanns/goworker" - "github.com/garyburd/redigo/redis" - "github.com/gocraft/health" "os" "sync/atomic" "time" + + "github.com/benmanns/goworker" + "github.com/gocraft/health" + "github.com/gomodule/redigo/redis" ) func myJob(queue string, args ...interface{}) error { diff --git a/benches/bench_goworkers/main.go b/benches/bench_goworkers/main.go index bd67b7d5..afbccc8b 100644 --- a/benches/bench_goworkers/main.go +++ b/benches/bench_goworkers/main.go @@ -2,12 +2,12 @@ package main import ( "fmt" - "github.com/garyburd/redigo/redis" - "github.com/gocraft/health" - "github.com/jrallison/go-workers" "os" "sync/atomic" "time" + + "github.com/gocraft/health" + "github.com/gomodule/redigo/redis" ) func myJob(m *workers.Msg) { diff --git a/benches/bench_jobs/main.go b/benches/bench_jobs/main.go index cf68f5fc..3ba5f165 100644 --- a/benches/bench_jobs/main.go +++ b/benches/bench_jobs/main.go @@ -2,12 +2,13 @@ package main import ( "fmt" - "github.com/albrow/jobs" - "github.com/garyburd/redigo/redis" - "github.com/gocraft/health" "os" "sync/atomic" "time" + + "github.com/albrow/jobs" + "github.com/gocraft/health" + "github.com/gomodule/redigo/redis" ) var namespace = "jobs" @@ -51,8 +52,8 @@ func main() { job = stream.NewJob("run_all") pool, err := jobs.NewPool(&jobs.PoolConfig{ - // NumWorkers: 1000, - // BatchSize: 3000, + // NumWorkers: 1000, + // BatchSize: 3000, }) if err != nil { panic(err) diff --git a/benches/bench_work/main.go b/benches/bench_work/main.go index 9184b61b..aaf1de69 100644 --- a/benches/bench_work/main.go +++ b/benches/bench_work/main.go @@ -2,12 +2,13 @@ package main import ( "fmt" - "github.com/garyburd/redigo/redis" - "github.com/gocraft/health" - "github.com/gocraft/work" "os" "sync/atomic" "time" + + "github.com/gocraft/health" + "github.com/gocraft/work" + "github.com/gomodule/redigo/redis" ) var namespace = "bench_test" diff --git a/client.go b/client.go index c7a2e7e9..939f33ca 100644 --- a/client.go +++ b/client.go @@ -2,10 +2,11 @@ package work import ( "fmt" - "github.com/garyburd/redigo/redis" "sort" "strconv" "strings" + + "github.com/gomodule/redigo/redis" ) // ErrNotDeleted is returned by functions that delete jobs to indicate that although the redis commands were successful, diff --git a/client_test.go b/client_test.go index a4cd7929..dc012441 100644 --- a/client_test.go +++ b/client_test.go @@ -2,10 +2,11 @@ package work import ( "fmt" - "github.com/garyburd/redigo/redis" - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/gomodule/redigo/redis" + "github.com/stretchr/testify/assert" ) type TestContext struct{} diff --git a/cmd/workenqueue/main.go b/cmd/workenqueue/main.go index fb08c3c3..924f6ec8 100644 --- a/cmd/workenqueue/main.go +++ b/cmd/workenqueue/main.go @@ -4,10 +4,11 @@ import ( "encoding/json" "flag" "fmt" - "github.com/garyburd/redigo/redis" - "github.com/gocraft/work" "os" "time" + + "github.com/gocraft/work" + "github.com/gomodule/redigo/redis" ) var redisHostPort = flag.String("redis", ":6379", "redis hostport") diff --git a/cmd/workfakedata/main.go b/cmd/workfakedata/main.go index 357fbf0d..72e77b04 100644 --- a/cmd/workfakedata/main.go +++ b/cmd/workfakedata/main.go @@ -3,10 +3,11 @@ package main import ( "flag" "fmt" - "github.com/garyburd/redigo/redis" - "github.com/gocraft/work" "math/rand" "time" + + "github.com/gocraft/work" + "github.com/gomodule/redigo/redis" ) var redisHostPort = flag.String("redis", ":6379", "redis hostport") diff --git a/cmd/workwebui/main.go b/cmd/workwebui/main.go index a596f760..6d3e32fc 100644 --- a/cmd/workwebui/main.go +++ b/cmd/workwebui/main.go @@ -8,8 +8,8 @@ import ( "strconv" "time" - "github.com/garyburd/redigo/redis" "github.com/gocraft/work/webui" + "github.com/gomodule/redigo/redis" ) var ( diff --git a/dead_pool_reaper.go b/dead_pool_reaper.go index b990ba7b..e930521e 100644 --- a/dead_pool_reaper.go +++ b/dead_pool_reaper.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" ) const ( diff --git a/dead_pool_reaper_test.go b/dead_pool_reaper_test.go index c043a695..6c21cbc6 100644 --- a/dead_pool_reaper_test.go +++ b/dead_pool_reaper_test.go @@ -1,10 +1,11 @@ package work import ( - "github.com/garyburd/redigo/redis" - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/gomodule/redigo/redis" + "github.com/stretchr/testify/assert" ) func TestDeadPoolReaper(t *testing.T) { diff --git a/enqueue.go b/enqueue.go index d1d99937..31c5b0a0 100644 --- a/enqueue.go +++ b/enqueue.go @@ -4,7 +4,7 @@ import ( "sync" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" ) // Enqueuer can enqueue jobs. diff --git a/heartbeater.go b/heartbeater.go index 363bcbda..ccc229c4 100644 --- a/heartbeater.go +++ b/heartbeater.go @@ -1,12 +1,12 @@ package work import ( - // "fmt" - "github.com/garyburd/redigo/redis" "os" "sort" "strings" "time" + + "github.com/gomodule/redigo/redis" ) const ( diff --git a/heartbeater_test.go b/heartbeater_test.go index dbc436b1..2af2d2a9 100644 --- a/heartbeater_test.go +++ b/heartbeater_test.go @@ -1,11 +1,11 @@ package work import ( - // "fmt" - "github.com/garyburd/redigo/redis" - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/gomodule/redigo/redis" + "github.com/stretchr/testify/assert" ) func TestHeartbeater(t *testing.T) { diff --git a/identifier_test.go b/identifier_test.go index 08f982b2..ccf89dfd 100644 --- a/identifier_test.go +++ b/identifier_test.go @@ -1,8 +1,6 @@ package work -import ( - "testing" -) +import "testing" func TestMakeIdentifier(t *testing.T) { id := makeIdentifier() diff --git a/job_test.go b/job_test.go index 97e2b99e..aa6222f2 100644 --- a/job_test.go +++ b/job_test.go @@ -1,9 +1,10 @@ package work import ( - "github.com/stretchr/testify/assert" "math" "testing" + + "github.com/stretchr/testify/assert" ) func TestJobArgumentExtraction(t *testing.T) { diff --git a/log.go b/log.go index dba55f4d..c661a51c 100644 --- a/log.go +++ b/log.go @@ -1,8 +1,6 @@ package work -import ( - "fmt" -) +import "fmt" func logError(key string, err error) { fmt.Printf("ERROR: %s - %s\n", key, err.Error()) diff --git a/observer.go b/observer.go index 5ddc0c53..5c96ac39 100644 --- a/observer.go +++ b/observer.go @@ -3,8 +3,9 @@ package work import ( "encoding/json" "fmt" - "github.com/garyburd/redigo/redis" "time" + + "github.com/gomodule/redigo/redis" ) // An observer observes a single worker. Each worker has its own observer. diff --git a/observer_test.go b/observer_test.go index 086d83c7..d95e729b 100644 --- a/observer_test.go +++ b/observer_test.go @@ -2,10 +2,10 @@ package work import ( "fmt" - "github.com/garyburd/redigo/redis" - "github.com/stretchr/testify/assert" "testing" - // "time" + + "github.com/gomodule/redigo/redis" + "github.com/stretchr/testify/assert" ) func TestObserverStarted(t *testing.T) { diff --git a/periodic_enqueuer.go b/periodic_enqueuer.go index 91085f70..b5e76765 100644 --- a/periodic_enqueuer.go +++ b/periodic_enqueuer.go @@ -2,10 +2,11 @@ package work import ( "fmt" - "github.com/garyburd/redigo/redis" - "github.com/robfig/cron" "math/rand" "time" + + "github.com/gomodule/redigo/redis" + "github.com/robfig/cron" ) const ( diff --git a/periodic_enqueuer_test.go b/periodic_enqueuer_test.go index 68d52b2f..4dfe46dc 100644 --- a/periodic_enqueuer_test.go +++ b/periodic_enqueuer_test.go @@ -1,11 +1,12 @@ package work import ( - "github.com/garyburd/redigo/redis" - "github.com/robfig/cron" - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/gomodule/redigo/redis" + "github.com/robfig/cron" + "github.com/stretchr/testify/assert" ) func TestPeriodicEnqueuer(t *testing.T) { diff --git a/priority_sampler_test.go b/priority_sampler_test.go index 97485aff..6117601c 100644 --- a/priority_sampler_test.go +++ b/priority_sampler_test.go @@ -2,8 +2,9 @@ package work import ( "fmt" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestPrioritySampler(t *testing.T) { diff --git a/requeuer.go b/requeuer.go index cd79de3f..55fa4513 100644 --- a/requeuer.go +++ b/requeuer.go @@ -1,11 +1,10 @@ package work import ( - // "encoding/json" "fmt" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" ) type requeuer struct { diff --git a/requeuer_test.go b/requeuer_test.go index 3d1a7f40..65418eca 100644 --- a/requeuer_test.go +++ b/requeuer_test.go @@ -1,12 +1,9 @@ package work import ( - // "github.com/garyburd/redigo/redis" - "github.com/stretchr/testify/assert" "testing" - // "fmt" - // "time" - // "os" + + "github.com/stretchr/testify/assert" ) func TestRequeue(t *testing.T) { diff --git a/run_test.go b/run_test.go index deb62dc2..5bf0d2c9 100644 --- a/run_test.go +++ b/run_test.go @@ -2,9 +2,10 @@ package work import ( "fmt" - "github.com/stretchr/testify/assert" "reflect" "testing" + + "github.com/stretchr/testify/assert" ) func TestRunBasicMiddleware(t *testing.T) { diff --git a/time.go b/time.go index cdfcad1f..a4548364 100644 --- a/time.go +++ b/time.go @@ -1,8 +1,6 @@ package work -import ( - "time" -) +import "time" var nowMock int64 diff --git a/webui/webui.go b/webui/webui.go index 428a761e..51e250d5 100644 --- a/webui/webui.go +++ b/webui/webui.go @@ -8,10 +8,10 @@ import ( "sync" "github.com/braintree/manners" - "github.com/garyburd/redigo/redis" "github.com/gocraft/web" "github.com/gocraft/work" "github.com/gocraft/work/webui/internal/assets" + "github.com/gomodule/redigo/redis" ) // Server implements an HTTP server which exposes a JSON API to view and manage gocraft/work items. diff --git a/webui/webui_test.go b/webui/webui_test.go index 3dda02dd..6bffc745 100644 --- a/webui/webui_test.go +++ b/webui/webui_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/garyburd/redigo/redis" "github.com/gocraft/work" + "github.com/gomodule/redigo/redis" "github.com/stretchr/testify/assert" ) diff --git a/worker.go b/worker.go index 576af161..06863cb7 100644 --- a/worker.go +++ b/worker.go @@ -6,7 +6,7 @@ import ( "reflect" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" ) const fetchKeysPerJobType = 6 diff --git a/worker_pool.go b/worker_pool.go index b70ec66d..702922ac 100644 --- a/worker_pool.go +++ b/worker_pool.go @@ -6,7 +6,7 @@ import ( "strings" "sync" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" "github.com/robfig/cron" ) diff --git a/worker_pool_test.go b/worker_pool_test.go index 42e2f2d4..911aa9dc 100644 --- a/worker_pool_test.go +++ b/worker_pool_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" "github.com/stretchr/testify/assert" ) diff --git a/worker_test.go b/worker_test.go index ddfbe544..23fdb0f5 100644 --- a/worker_test.go +++ b/worker_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/garyburd/redigo/redis" + "github.com/gomodule/redigo/redis" "github.com/stretchr/testify/assert" )