Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore: remote context.Context pointer (#2448)
Athurg Gooth215981dfde83
diff --git a/api/v1/resource.go b/api/v1/resource.goindex 63825866d..61ca18a7f 100644--- a/api/v1/resource.go+++ b/api/v1/resource.go@@ -187,7 +187,7 @@ func (s *APIV1Service) UploadResource(c echo.Context) error {}// This is the backend default max upload size limit.- maxUploadSetting := s.Store.GetSystemSettingValueWithDefault(&ctx, SystemSettingMaxUploadSizeMiBName.String(), "32")+ maxUploadSetting := s.Store.GetSystemSettingValueWithDefault(ctx, SystemSettingMaxUploadSizeMiBName.String(), "32")var settingMaxUploadSizeBytes intif settingMaxUploadSizeMiB, err := strconv.Atoi(maxUploadSetting); err == nil {settingMaxUploadSizeBytes = settingMaxUploadSizeMiB * MebiBytediff --git a/server/integration/telegram.go b/server/integration/telegram.goindex 56ea219f9..902935b12 100644--- a/server/integration/telegram.go+++ b/server/integration/telegram.go@@ -24,7 +24,7 @@ func NewTelegramHandler(store *store.Store) *TelegramHandler {}func (t *TelegramHandler) BotToken(ctx context.Context) string {- return t.store.GetSystemSettingValueWithDefault(&ctx, apiv1.SystemSettingTelegramBotTokenName.String(), "")+ return t.store.GetSystemSettingValueWithDefault(ctx, apiv1.SystemSettingTelegramBotTokenName.String(), "")}const (diff --git a/server/service/backup/backup.go b/server/service/backup/backup.goindex 4747ab28f..b11da7cfb 100644--- a/server/service/backup/backup.go+++ b/server/service/backup/backup.go@@ -25,7 +25,7 @@ func NewBackupRunner(store *store.Store) *BackupRunner {}func (r *BackupRunner) Run(ctx context.Context) {- intervalStr := r.Store.GetSystemSettingValueWithDefault(&ctx, apiv1.SystemSettingAutoBackupIntervalName.String(), "")+ intervalStr := r.Store.GetSystemSettingValueWithDefault(ctx, apiv1.SystemSettingAutoBackupIntervalName.String(), "")if intervalStr == "" {log.Debug("no SystemSettingAutoBackupIntervalName setting, disable auto backup")returndiff --git a/store/system_setting.go b/store/system_setting.goindex 6d7b48c1d..9ae3232c9 100644--- a/store/system_setting.go+++ b/store/system_setting.go@@ -51,8 +51,8 @@ func (s *Store) GetSystemSetting(ctx context.Context, find *FindSystemSetting) (return systemSettingMessage, nil}-func (s *Store) GetSystemSettingValueWithDefault(ctx *context.Context, settingName string, defaultValue string) string {- if setting, err := s.GetSystemSetting(*ctx, &FindSystemSetting{+func (s *Store) GetSystemSettingValueWithDefault(ctx context.Context, settingName string, defaultValue string) string {+ if setting, err := s.GetSystemSetting(ctx, &FindSystemSetting{Name: settingName,}); err == nil && setting != nil {return setting.Value