Upgrade to Go 1.7 (#128)

* Upgrade to stdlib context package
* Modernized syntax
This commit is contained in:
C Cirello
2016-10-06 20:10:00 +02:00
committed by Seif Lotfy سيف لطفي
parent e90a109ed5
commit 3ca137a01c
27 changed files with 40 additions and 56 deletions

View File

@@ -1,6 +1,7 @@
package mqs
import (
"context"
"errors"
"math/rand"
"sync"
@@ -10,7 +11,6 @@ import (
"github.com/google/btree"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/runner/common"
"golang.org/x/net/context"
)
type MemoryMQ struct {
@@ -59,7 +59,7 @@ func NewMemoryMQ() *MemoryMQ {
func (mq *MemoryMQ) start() {
// start goroutine to check for delayed jobs and put them onto regular queue when ready
go func() {
for _ = range mq.Ticker.C {
for range mq.Ticker.C {
ji := &TaskItem{
StartAt: time.Now(),
}
@@ -80,7 +80,7 @@ func (mq *MemoryMQ) start() {
// start goroutine to check for messages that have timed out and put them back onto regular queue
// TODO: this should be like the delayed messages above. Could even be the same thing as delayed messages, but remove them if job is completed.
go func() {
for _ = range mq.Ticker.C {
for range mq.Ticker.C {
ji := &TaskItem{
StartAt: time.Now(),
}