Skip to content

Commit

Permalink
Fixed linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfly19 committed Jul 30, 2021
1 parent 80cf616 commit 6b36d66
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion redisList-http-connector/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/fission/keda-connectors/redisList
go 1.15

require (
github.com/fission/keda-connectors/common v0.0.0-20210709053953-72ffb46087e6
github.com/fission/keda-connectors/common v0.0.0-20210715121053-d4c68ea77bc3
github.com/go-redis/redis/v8 v8.11.0
go.uber.org/zap v1.18.1
)
4 changes: 2 additions & 2 deletions redisList-http-connector/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/fission/keda-connectors/common v0.0.0-20210709053953-72ffb46087e6 h1:4BUYUR27cFSH4f+ibRe1/4dSe9ivQyq4jT+uglsJfOU=
github.com/fission/keda-connectors/common v0.0.0-20210709053953-72ffb46087e6/go.mod h1:eJ7ViC/moBvbXCIxlbT4JLfMi8dg00SnjyNyYvD0vg8=
github.com/fission/keda-connectors/common v0.0.0-20210715121053-d4c68ea77bc3 h1:1NGHwgHDbUTXjSypnxfyvqksaWg4mDH/scxwplo7rE4=
github.com/fission/keda-connectors/common v0.0.0-20210715121053-d4c68ea77bc3/go.mod h1:eJ7ViC/moBvbXCIxlbT4JLfMi8dg00SnjyNyYvD0vg8=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
Expand Down
10 changes: 6 additions & 4 deletions redisList-http-connector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package main

import (
"context"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"

"github.com/fission/keda-connectors/common"
"github.com/go-redis/redis/v8"
"go.uber.org/zap"

"github.com/fission/keda-connectors/common"
)

type redisListConnector struct {
Expand All @@ -34,8 +36,8 @@ func (conn redisListConnector) consumeMessage(ctx context.Context) {

forever := make(chan bool)
go func() {
for message := range messages {
response, err := common.HandleHTTPRequest(string(message), headers, conn.connectordata, conn.logger)
for _, message := range messages {
response, err := common.HandleHTTPRequest(message, headers, conn.connectordata, conn.logger)
if err != nil {
conn.errorHandler(ctx, err)
} else {
Expand All @@ -45,7 +47,7 @@ func (conn redisListConnector) consumeMessage(ctx context.Context) {
conn.errorHandler(ctx, err)
} else {
if success := conn.responseHandler(ctx, string(body)); success {
//Ack
fmt.Println("Successful")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion redisList-http-connector/test/consumer/consume_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
for i = 0; i < list_len; i++ {
msg, err := rdb.LPop(ctx, "test_queue").Result()
if err != nil {
log.Fatalf("Error in consuming queue: ", err)
log.Fatalf("Error in consuming queue: %v", err)
panic(err.Error())
}
fmt.Println(msg)
Expand Down
4 changes: 2 additions & 2 deletions redisList-http-connector/test/publisher/publish_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func main() {
resp_json, _ := json.Marshal(resp)
_, err := rdb.RPush(ctx, "test_queue", resp_json).Result()
if err != nil {
log.Fatalf("Error publishing messages", err)
log.Fatalf("Error publishing messages: %v", err)
panic(err.Error())
}
}
fmt.Println("Message publishing successfull!")
fmt.Println("Message publishing successful!")
}

0 comments on commit 6b36d66

Please sign in to comment.