MCPcopy
hub / github.com/usememos/memos / GetInstanceGeneralSetting

Method GetInstanceGeneralSetting

store/instance_setting.go:127–144  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

125}
126
127func (s *Store) GetInstanceGeneralSetting(ctx context.Context) (*storepb.InstanceGeneralSetting, error) {
128 instanceSetting, err := s.GetInstanceSetting(ctx, &FindInstanceSetting{
129 Name: storepb.InstanceSettingKey_GENERAL.String(),
130 })
131 if err != nil {
132 return nil, errors.Wrap(err, "failed to get instance general setting")
133 }
134
135 instanceGeneralSetting := &storepb.InstanceGeneralSetting{}
136 if instanceSetting != nil {
137 instanceGeneralSetting = instanceSetting.GetGeneralSetting()
138 }
139 s.instanceSettingCache.Set(ctx, storepb.InstanceSettingKey_GENERAL.String(), &storepb.InstanceSetting{
140 Key: storepb.InstanceSettingKey_GENERAL,
141 Value: &storepb.InstanceSetting_GeneralSetting{GeneralSetting: instanceGeneralSetting},
142 })
143 return instanceGeneralSetting, nil
144}
145
146// DefaultContentLengthLimit is the default limit of content length in bytes. 8KB.
147const DefaultContentLengthLimit = 8 * 1024

Callers 8

getRSSHeadingFunction · 0.80
CreateUserMethod · 0.80
UpdateUserMethod · 0.80
SignInMethod · 0.80
resolveSSOUserMethod · 0.80

Calls 4

GetInstanceSettingMethod · 0.95
SetMethod · 0.65
StringMethod · 0.45
GetGeneralSettingMethod · 0.45

Tested by 2