Compare commits

...

2 commits

Author SHA1 Message Date
DataHoarder 817a668aaf
Limit initial file loading
All checks were successful
continuous-integration/drone/push Build is passing
2022-08-04 18:17:30 +02:00
DataHoarder 201b0d0879
Add gcc to test 2022-08-04 18:17:30 +02:00
2 changed files with 7 additions and 0 deletions

View file

@ -7,6 +7,7 @@ steps:
- name: backend
image: golang:1.19-alpine
commands:
- apk update && apk add --no-cache gcc musl-dev
- GOAMD64=v2 go build -v -o srg .
...

View file

@ -16,6 +16,7 @@ import (
"os"
"runtime"
"sync/atomic"
"time"
)
type HashFileResult struct {
@ -265,6 +266,11 @@ func main() {
path := scanner.Text()
atomic.AddInt64(&entries, 1)
for atomic.LoadInt64(&taskCount) >= (int64(*taskLimit) + 1) {
runtime.Gosched()
time.Sleep(time.Millisecond * 20)
}
atomic.AddInt64(&taskCount, 1)
go func() {
defer atomic.AddInt64(&taskCount, -1)