Skip to content

Commit

Permalink
feat: redundancy ci
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Feb 27, 2024
1 parent 5de732c commit 8ca48d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/beekeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ jobs:
- name: Test staking
id: stake
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-stake
- name: Test redundancy
id: redundancy
run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-redundancy
- name: Collect debug artifacts
if: failure()
run: |
Expand Down
9 changes: 5 additions & 4 deletions pkg/api/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ func (s *Service) chunkUploadHandler(w http.ResponseWriter, r *http.Request) {
return
}

chunk, err := cac.NewWithDataSpan(data)
hash, err := cac.DoHash(data[swarm.SpanSize:], data[:swarm.SpanSize])
if err != nil {
logger.Debug("chunk upload: create chunk failed", "error", err)
logger.Error(nil, "chunk upload: create chunk error")
jsonhttp.InternalServerError(ow, "create chunk error")
logger.Debug("chunk upload: hash data", "error", err)
logger.Error(nil, "chunk upload: hash data error")
jsonhttp.InternalServerError(ow, "hash data error")
return
}

chunk := swarm.NewChunk(swarm.NewAddress(hash), data)
err = putter.Put(r.Context(), chunk)
if err != nil {
logger.Debug("chunk upload: write chunk failed", "chunk_address", chunk.Address(), "error", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (s *Service) mountAPI() {

handle("/chunks", jsonhttp.MethodHandler{
"POST": web.ChainHandlers(
jsonhttp.NewMaxBodyBytesHandler(swarm.ChunkWithSpanSize),
jsonhttp.NewMaxBodyBytesHandler(swarm.SocMaxChunkSize),
web.FinalHandlerFunc(s.chunkUploadHandler),
),
})
Expand Down

0 comments on commit 8ca48d5

Please sign in to comment.