Skip to content

Commit da3e960

Browse files
authored
ci: uci/copy-templates (#14)
* chore: add or force update .github/workflows/go-test.yml * chore: add or force update .github/workflows/go-check.yml * chore: add or force update .github/workflows/releaser.yml * chore: add or force update .github/workflows/release-check.yml * chore: add or force update .github/workflows/tagpush.yml * GetN returns an error if the queue is closed (#16)
1 parent b9fd706 commit da3e960

File tree

6 files changed

+108
-1
lines changed

6 files changed

+108
-1
lines changed

.github/workflows/go-check.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Go Checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
merge_group:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
go-check:
19+
uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@v1

.github/workflows/go-test.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Go Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ["main"]
7+
workflow_dispatch:
8+
merge_group:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
go-test:
19+
uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@v1
20+
secrets:
21+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Checker
2+
3+
on:
4+
pull_request_target:
5+
paths: ["version.json"]
6+
types: [ opened, synchronize, reopened, labeled, unlabeled ]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
release-check:
19+
uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@v1
20+
with:
21+
sources: '["version.json"]'

.github/workflows/releaser.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Releaser
2+
3+
on:
4+
push:
5+
paths: ["version.json"]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.sha }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
releaser:
17+
uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1
18+
with:
19+
sources: '["version.json"]'
20+
secrets:
21+
UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }}

.github/workflows/tagpush.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Tag Push Checker
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
permissions:
9+
contents: read
10+
issues: write
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
releaser:
18+
uses: ipdxco/unified-github-workflows/.github/workflows/tagpush.yml@v1

dsqueue.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,17 @@ func (q *DSQueue) GetN(n int) ([][]byte, error) {
133133
return nil, nil
134134
}
135135
rsp := make(chan getResponse)
136-
q.getn <- getRequest{
136+
req := getRequest{
137137
n: n,
138138
rsp: rsp,
139139
}
140+
141+
select {
142+
case q.getn <- req:
143+
case <-q.closed:
144+
return nil, fmt.Errorf("%s queue closed", q.name)
145+
}
146+
140147
getRsp := <-rsp
141148
return getRsp.items, getRsp.err
142149
}

0 commit comments

Comments
 (0)