Skip to content

Commit

Permalink
use a different session
Browse files Browse the repository at this point in the history
  • Loading branch information
ramin committed Apr 26, 2024
1 parent 41fb73c commit 748a539
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 7 additions & 2 deletions aws/session/session.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package session

import "github.com/aws/aws-sdk-go/aws/session"
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
)

// NewDynamicSession is a factory to emit sessions
// relevant to the current config, ie:
//
// dev, local, sandbox, production
func NewDynamicSession() *session.Session {
return session.Must(session.NewSession())
return session.Must(session.NewSession(
aws.NewConfig().WithRegion("us-east-1"),
))
}
8 changes: 3 additions & 5 deletions events/publishers/aws/kinesis/kinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ package kinesis
import (
"time"

"github.com/edobtc/cloudkit/aws/session"
"github.com/edobtc/cloudkit/config"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"

"github.com/aws/aws-sdk-go/service/kinesis"

log "github.com/sirupsen/logrus"
)

var ApplicationPublisher = NewPublisher()

type Publisher struct {
Name string
Buffer []byte
svc *kinesis.Kinesis
}

func NewPublisher() *Publisher {
s := session.Must(session.NewSession())
s := session.NewDynamicSession()

return &Publisher{
Buffer: []byte{},
Expand All @@ -40,7 +39,6 @@ func (s *Publisher) Send(data []byte) error {
if err != nil {
return err
}

log.Debug("Publisher debug: ", po.SequenceNumber)

return nil
Expand Down
1 change: 0 additions & 1 deletion events/subscribers/lightning/eclair/ws/ws.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (s *EclairSubscriber) Start() chan bool {
for {
select {
case msg := <-channel:
fmt.Println("message received: ", msg)
s.listener <- msg
case <-s.Close:
s.Wait <- true
Expand Down

0 comments on commit 748a539

Please sign in to comment.