Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- 1.7
- 1.11.1

script:
- go get github.com/customerio/gospec
Expand Down
12 changes: 7 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"strconv"
"time"

"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

type config struct {
processId string
ProcessId string
Namespace string
PollInterval int
Pool *redis.Pool
Expand Down Expand Up @@ -73,8 +73,10 @@ func Configure(options map[string]string) {
return err
},
},
func(queue string) Fetcher {
return NewFetch(queue, make(chan *Msg), make(chan bool))
},
DefaultFetch,
}
}

func DefaultFetch(queue string) Fetcher {
return NewFetch(queue, make(chan *Msg), make(chan bool))
}
4 changes: 2 additions & 2 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func ConfigSpec(c gospec.Context) {
})

c.Specify("can specify custom process", func() {
c.Expect(Config.processId, Equals, "1")
c.Expect(Config.ProcessId, Equals, "1")

Configure(map[string]string{
"server": "localhost:6379",
"process": "2",
})

c.Expect(Config.processId, Equals, "2")
c.Expect(Config.ProcessId, Equals, "2")
})

c.Specify("requires a server parameter", func() {
Expand Down
2 changes: 1 addition & 1 deletion enqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/customerio/gospec"
. "github.com/customerio/gospec"
"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

func EnqueueSpec(c gospec.Context) {
Expand Down
2 changes: 1 addition & 1 deletion fetch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package workers
import (
"github.com/customerio/gospec"
. "github.com/customerio/gospec"
"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

func buildFetch(queue string) Fetcher {
Expand Down
4 changes: 2 additions & 2 deletions fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

type Fetcher interface {
Expand Down Expand Up @@ -152,5 +152,5 @@ func (f *fetch) inprogressMessages() []string {
}

func (f *fetch) inprogressQueue() string {
return fmt.Sprint(f.queue, ":", Config.processId, ":inprogress")
return fmt.Sprint(f.queue, ":", Config.ProcessId, ":inprogress")
}
9 changes: 6 additions & 3 deletions manager_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package workers

import (
"fmt"
"reflect"
"runtime"
"sync"
"time"

"github.com/customerio/gospec"
. "github.com/customerio/gospec"
"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

type customMid struct {
Expand Down Expand Up @@ -54,7 +55,9 @@ func ManagerSpec(c gospec.Context) {

c.Specify("sets job function", func() {
manager := newManager("myqueue", testJob, 10)
c.Expect(fmt.Sprint(manager.job), Equals, fmt.Sprint(testJob))
expected := runtime.FuncForPC(reflect.ValueOf(manager.job).Pointer()).Name()
actual := runtime.FuncForPC(reflect.ValueOf(testJob).Pointer()).Name()
c.Expect(expected, Equals, actual)
})

c.Specify("sets worker concurrency", func() {
Expand Down
2 changes: 1 addition & 1 deletion middleware_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package workers
import (
"github.com/customerio/gospec"
. "github.com/customerio/gospec"
"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion middleware_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package workers
import (
"github.com/customerio/gospec"
. "github.com/customerio/gospec"
"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion scheduled.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"time"

"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

type scheduled struct {
Expand Down
2 changes: 1 addition & 1 deletion scheduled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package workers
import (
"github.com/customerio/gospec"
. "github.com/customerio/gospec"
"github.com/garyburd/redigo/redis"
"github.com/gomodule/redigo/redis"
)

func ScheduledSpec(c gospec.Context) {
Expand Down