MCPcopy Index your code
hub / github.com/InferCore/InferCore / createLedgerRequest

Method createLedgerRequest

internal/server/server.go:435–457  ·  view source on GitHub ↗
(ctx context.Context, traceID, requestID string, req types.AIRequest, now time.Time)

Source from the content-addressed store, hash-verified

433}
434
435func (s *Server) createLedgerRequest(ctx context.Context, traceID, requestID string, req types.AIRequest, now time.Time) {
436 if s.ledger == nil {
437 return
438 }
439 in, _ := json.Marshal(req.Input)
440 ctxb, _ := json.Marshal(req.Context)
441 full, _ := json.Marshal(req)
442 _ = s.ledger.CreateRequest(ctx, requests.RequestRow{
443 RequestID: requestID,
444 TraceID: traceID,
445 RequestType: req.RequestType,
446 TenantID: req.TenantID,
447 TaskType: req.TaskType,
448 Priority: req.Priority,
449 PipelineRef: req.PipelineRef,
450 InputJSON: in,
451 ContextJSON: ctxb,
452 AIRequestJSON: full,
453 Status: "running",
454 CreatedAt: now,
455 UpdatedAt: now,
456 })
457}
458
459func (s *Server) updateLedgerFailed(ctx context.Context, requestID string) {
460 if s.ledger == nil {

Callers 1

CreateRequestMethod · 0.80

Calls 1

CreateRequestMethod · 0.65

Tested by

no test coverage detected