Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #97 from JackalLabs/proof-slowdown
Browse files Browse the repository at this point in the history
Fix: Sequential Proof Slowdown
  • Loading branch information
TheMarstonConnell authored Aug 24, 2023
2 parents 5a21ccd + 3f9ea9f commit 9e34c79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions jprov/server/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ func attest(w *http.ResponseWriter, r *http.Request, cmd *cobra.Command, q *queu
return
}

if upload.Response == nil {
http.Error(*w, fmt.Errorf(upload.Response.RawLog).Error(), http.StatusBadRequest)
return
}

if upload.Response.Code != 0 {
http.Error(*w, fmt.Errorf(upload.Response.RawLog).Error(), http.StatusBadRequest)
return
Expand Down
12 changes: 7 additions & 5 deletions jprov/server/proofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,13 @@ func postProofs(cmd *cobra.Command, db *leveldb.DB, q *queue.UploadQueue, ctx *u
continue
}

err = postProof(clientCtx, cid, block, db, q, ctx)
if err != nil {
ctx.Logger.Error(fmt.Sprintf("Posting Proof Error: %v", err))
continue
}
go func() {
err = postProof(clientCtx, cid, block, db, q, ctx)
if err != nil {
ctx.Logger.Error(fmt.Sprintf("Posting Proof Error: %v", err))
}
}()

sleep, err := cmd.Flags().GetInt64(types.FlagSleep)
if err != nil {
ctx.Logger.Error(err.Error())
Expand Down

0 comments on commit 9e34c79

Please sign in to comment.