Skip to content

Commit

Permalink
Release v0.10.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamil-Najafov authored Sep 25, 2024
2 parents 1ab9cb8 + 1101d98 commit e4c3570
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/security_allinone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Security AllInOne
on:
push:
branches: '**'
pull_request:
types:
- opened
- closed
- ready_for_review
jobs:
build:
runs-on:
group: default
labels: self-hosted
steps:
- name: Trigger to Insider Security
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{"type": "security-allinone", "version": "v1", "repository": "${{ github.event.repository.name }}", "ref": "${{ github.head_ref || github.ref_name }}", "event_name": "${{ github.event_name }}", "event_action": "${{ github.event.action }}", "default_branch": "${{ github.event.repository.default_branch }}"}' \
$INSECPROXY_HOOK
env:
INSECPROXY_HOOK: ${{ secrets.INSECPROXY_HOOK }}
24 changes: 24 additions & 0 deletions inskinesis/customretryer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package inskinesis

import (
"github.com/aws/aws-sdk-go/aws/request"
"net"
"strings"
)

// CustomRetryer retries on "connection reset by peer"
type CustomRetryer struct {
request.Retryer
}

func (r CustomRetryer) ShouldRetry(req *request.Request) bool {
if err, ok := req.Error.(net.Error); ok && err.Timeout() {
return true
}

if opErr, ok := req.Error.(*net.OpError); ok && strings.Contains(opErr.Err.Error(), "connection reset by peer") {
return true
}

return r.Retryer.ShouldRetry(req)
}
7 changes: 7 additions & 0 deletions inskinesis/inskinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/aws/aws-sdk-go/aws/client"
"math"
"sync"
"time"
Expand Down Expand Up @@ -94,6 +95,12 @@ func NewKinesis(config Config) (StreamInterface, error) {
return nil, err
}

awsSession.Config.Retryer = CustomRetryer{
Retryer: client.DefaultRetryer{
NumMaxRetries: 3,
},
}

kinesisClient := kinesis.New(awsSession)

s := &stream{
Expand Down

0 comments on commit e4c3570

Please sign in to comment.