Skip to content

Commit

Permalink
more debug
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Sep 27, 2024
1 parent 2f9e183 commit 07b28f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion handler/app/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"math"
"net/http"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -165,8 +166,9 @@ func artifacts(c echo.Context, db *sql.DB, uri string, page int) error {
if err != nil {
return DatabaseErr(c, errs, err)
}
boil.DebugMode = false // TODO remove
data[records] = r
fmt.Println("RECORDS OF ARTIFACTS: ", len(r))
fmt.Fprintln(os.Stderr, "RECORDS OF ARTIFACTS: ", len(r))
d, sum, err := stats(ctx, db, uri)
if err != nil {
return DatabaseErr(c, errs, err)
Expand Down
5 changes: 4 additions & 1 deletion model/artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"fmt"
"io"
"os"

"github.com/Defacto2/server/internal/postgres"
"github.com/Defacto2/server/internal/postgres/models"
Expand Down Expand Up @@ -155,12 +156,14 @@ func (f *Artifacts) ByForApproval(ctx context.Context, exec boil.ContextExecutor
if invalidExec(exec) {
return nil, ErrDB
}
fmt.Fprintln(os.Stderr, "========================ByForApproval===============================")
boil.DebugMode = true // TODO: remove this debug line
if err := f.byForApproval(ctx, exec); err != nil {
fmt.Fprintln(os.Stderr, "BYFORAPPROVAL", err)
fmt.Fprint(io.Discard, err)
return nil, nil
}
fmt.Println("B", f.Bytes, "C", f.Count)
fmt.Fprintln(os.Stderr, "B", f.Bytes, "C", f.Count)
const clause = "id DESC"
return models.Files(
qm.WithDeleted(),
Expand Down

0 comments on commit 07b28f6

Please sign in to comment.