MCPcopy Index your code
hub / github.com/apache/answer / SetCache

Method SetCache

internal/service/question_common/question.go:625–636  ·  view source on GitHub ↗
(ctx context.Context, cachekey string, info any)

Source from the content-addressed store, hash-verified

623}
624
625func (qs *QuestionCommon) SetCache(ctx context.Context, cachekey string, info any) error {
626 infoStr, err := json.Marshal(info)
627 if err != nil {
628 return errors.InternalServer(reason.UnknownError).WithError(err).WithStack()
629 }
630
631 err = qs.data.Cache.SetString(ctx, cachekey, string(infoStr), schema.DashboardCacheTime)
632 if err != nil {
633 return errors.InternalServer(reason.UnknownError).WithError(err).WithStack()
634 }
635 return nil
636}
637
638func (qs *QuestionCommon) ShowListFormat(ctx context.Context, data *entity.Question) *schema.QuestionInfoResp {
639 return qs.ShowFormat(ctx, data)

Callers

nothing calls this directly

Calls 1

SetStringMethod · 0.80

Tested by

no test coverage detected