Skip to content

Commit

Permalink
Fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfly19 committed Aug 30, 2021
1 parent a681478 commit 19b07c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
5 changes: 4 additions & 1 deletion redis-http-connector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ func main() {
}
defer logger.Sync()

connectordata, _ := common.ParseConnectorMetadata()
connectordata, err := common.ParseConnectorMetadata()
if err != nil {
logger.Error("Error while parsing connector metadata", zap.Error(err))
}

address := os.Getenv("ADDRESS")
if address == "" {
Expand Down
16 changes: 9 additions & 7 deletions redis-http-connector/test/consumer/consume_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,32 @@ import (
"context"
"fmt"
"log"
"os"

"github.com/go-redis/redis/v8"
)

func main() {

/*address := os.Getenv("REDIS_ADDRESS")
address := os.Getenv("REDIS_ADDRESS")
if address == "" {
log.Fatalf("Empty address field")
}
password := os.Getenv("REDIS_PASSWORD")*/
address := "127.0.0.1:6379"
password := ""
password := os.Getenv("REDIS_PASSWORD")

var ctx = context.Background()
var i int64
var listItr int64
rdb := redis.NewClient(&redis.Options{
Addr: address,
Password: password,
})

list_len, err := rdb.LLen(ctx, "response-topic").Result()
listLength, err := rdb.LLen(ctx, "response-topic").Result()
if err != nil {
log.Fatalf("Error in consuming queue: %v", err)
}

for i = 0; i < list_len; i++ {
for listItr = 0; listItr < listLength; listItr++ {
msg, err := rdb.LPop(ctx, "response-topic").Result()

if err != nil {
Expand Down

0 comments on commit 19b07c7

Please sign in to comment.