Skip to content

Commit 61c41b8

Browse files
committed
Fixes for hanging jobs, more verbose ci output
1 parent 47d7896 commit 61c41b8

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

backend/internal/jobqueue/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var (
1616
func Start() {
1717
ctx, cancel = context.WithCancel(context.Background())
1818
q := &Queue{
19-
jobs: make(chan Job),
19+
jobs: make(chan Job, 10),
2020
ctx: ctx,
2121
cancel: cancel,
2222
}

backend/internal/jobqueue/models.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ type Queue struct {
1010
jobs chan Job
1111
ctx context.Context
1212
cancel context.CancelFunc
13+
mu sync.Mutex
1314
}
1415

1516
// Job - holds logic to perform some operations during queue execution.
@@ -41,6 +42,8 @@ func (q *Queue) AddJobs(jobs []Job) {
4142

4243
// AddJob sends job to the channel.
4344
func (q *Queue) AddJob(job Job) {
45+
q.mu.Lock()
46+
defer q.mu.Unlock()
4447
q.jobs <- job
4548
}
4649

docker/dev/dnsrouter-config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
"internal": null,
2525
"default_upstream": "127.0.0.11"
2626
}
27-
]
28-
}
27+
],
28+
"cache": {
29+
"disabled": true
30+
}
31+
}

docker/docker-compose.ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ services:
7575
image: jc21/dnsrouter
7676
volumes:
7777
- ./dev/dnsrouter-config.json.tmp:/dnsrouter-config.json:ro
78+
entrypoint: /dnsrouter -v -c /dnsrouter-config.json
7879

7980
cypress:
8081
image: "${IMAGE}-cypress:ci-${BUILD_NUMBER}"

test/cypress/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ FROM cypress/included:13.15.1
22

33
COPY --chown=1000 ./test /test
44

5-
# Disable Cypress CLI colors
6-
ENV FORCE_COLOR=0
7-
ENV NO_COLOR=1
5+
# Disable Cypress CLI colors by default
6+
ARG FORCE_COLOR=0
7+
ARG NO_COLOR=1
8+
ENV FORCE_COLOR=$FORCE_COLOR \
9+
NO_COLOR=$NO_COLOR
810

911
WORKDIR /test
1012
RUN yarn install && yarn cache clean

0 commit comments

Comments
 (0)