| 125 | } |
| 126 | |
| 127 | func (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. |
| 147 | const DefaultContentLengthLimit = 8 * 1024 |