Skip to content

Commit

Permalink
chore: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Bidon15 committed May 22, 2023
1 parent 6a6eb3a commit 2a8214c
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.18
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.37
version: v1.47
args: --concurrency 32 --deadline 4m
build-test:
name: build and test
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x
go-version: 1.18.x
- name: Checkout code
uses: actions/checkout@v2
- name: Build
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/docker-publish-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
branches:
- master

env:
REGISTRY: ghcr.io

jobs:
docker:
runs-on: ubuntu-latest
Expand All @@ -14,15 +17,16 @@ jobs:
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
- name: Login to GHCR
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: "${{ env.ORGANIZATION }}/sync-service:edge"
tags: "${{ env.REGISTRY }}/celestiaorg/sync-service:edge"
file: ./Dockerfile
platforms: linux/arm64,linux/amd64
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ node_modules
/vendor/
/Godeps/

### IDEA ###
.idea/*

### VisualStudioCode ###
.vscode/*

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#:::

# GO_VERSION is the golang version this image will be built against.
ARG GO_VERSION=1.16
ARG GO_VERSION=1.18

# Dynamically select the golang version.
FROM golang:${GO_VERSION}-buster
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:
cd cmd && go build -o ../sync-service

docker:
docker build -t iptestground/sync-service:latest -f Dockerfile .
docker build -t celestiaorg/sync-service:latest -f Dockerfile .

test:
go test -v ./...
8 changes: 5 additions & 3 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"nhooyr.io/websocket/wsjson"
)

const timeout = time.Minute * 5

type connection struct {
*websocket.Conn
service Service
Expand Down Expand Up @@ -57,7 +59,7 @@ func (c *connection) consumeRequests() error {
}

func (c *connection) publishHandler(id string, req *PublishRequest) {
ctx, cancel := context.WithTimeout(c.ctx, time.Second*10)
ctx, cancel := context.WithTimeout(c.ctx, timeout)
defer cancel()

resp := &Response{ID: id}
Expand Down Expand Up @@ -113,7 +115,7 @@ func (c *connection) barrierHandler(id string, req *BarrierRequest) {
}

func (c *connection) signalEntryHandler(id string, req *SignalEntryRequest) {
ctx, cancel := context.WithTimeout(c.ctx, time.Second*10)
ctx, cancel := context.WithTimeout(c.ctx, timeout)
defer cancel()

resp := &Response{ID: id}
Expand All @@ -132,7 +134,7 @@ func (c *connection) consumeResponses() error {
for {
select {
case resp := <-c.responses:
err := c.writeTimeout(time.Second*10, resp)
err := c.writeTimeout(timeout, resp)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (ps *pubsub) writeMessages() {
defer ps.msgsMu.RUnlock()

for _, msg := range ps.msgs[sub.last:] {
err := sub.write(time.Second*5, msg)
err := sub.write(time.Minute, msg)
if err != nil {
log.Warnf("cannot send message to subscriber: %w", err)
break
Expand Down

0 comments on commit 2a8214c

Please sign in to comment.