Skip to content

Commit

Permalink
fix: handle deleted mod dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Oct 11, 2024
1 parent e7a2795 commit 409e741
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,8 @@ func Setup(ctx context.Context) *echo.Echo {
slog.String("time_rfc3339", time.Now().Format(time.RFC3339)),
slog.String("remote_ip", c.RealIP()),
slog.String("host", req.Host),
slog.String("uri", req.RequestURI),
slog.String("method", req.Method),
slog.String("path", p),
slog.String("referer", req.Referer()),
slog.String("user_agent", req.UserAgent()),
slog.Int("status", res.Status),
slog.Int64("latency", stop.Sub(start).Nanoseconds()/1000),
Expand Down
4 changes: 3 additions & 1 deletion gql/resolver_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ func (r *versionResolver) Dependencies(ctx context.Context, obj *generated.Versi
}

for _, dependency := range dependencies {
dependency.ModID = dependency.Edges.Mod.ModReference
if dependency.Edges.Mod != nil {
dependency.ModID = dependency.Edges.Mod.ModReference
}
}

versionDependencyCache.SetWithTTL(obj.ID, dependencies, int64(len(dependencies)), versionDependencyCacheTTL)
Expand Down

0 comments on commit 409e741

Please sign in to comment.