Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
215981df
Unverified
Commit
215981df
authored
Oct 26, 2023
by
Athurg Gooth
Committed by
GitHub
Oct 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remote context.Context pointer (#2448)
remote context.Context pointer
parent
bfdb33f2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
resource.go
api/v1/resource.go
+1
-1
telegram.go
server/integration/telegram.go
+1
-1
backup.go
server/service/backup/backup.go
+1
-1
system_setting.go
store/system_setting.go
+2
-2
No files found.
api/v1/resource.go
View file @
215981df
...
@@ -187,7 +187,7 @@ func (s *APIV1Service) UploadResource(c echo.Context) error {
...
@@ -187,7 +187,7 @@ func (s *APIV1Service) UploadResource(c echo.Context) error {
}
}
// This is the backend default max upload size limit.
// 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
int
var
settingMaxUploadSizeBytes
int
if
settingMaxUploadSizeMiB
,
err
:=
strconv
.
Atoi
(
maxUploadSetting
);
err
==
nil
{
if
settingMaxUploadSizeMiB
,
err
:=
strconv
.
Atoi
(
maxUploadSetting
);
err
==
nil
{
settingMaxUploadSizeBytes
=
settingMaxUploadSizeMiB
*
MebiByte
settingMaxUploadSizeBytes
=
settingMaxUploadSizeMiB
*
MebiByte
...
...
server/integration/telegram.go
View file @
215981df
...
@@ -24,7 +24,7 @@ func NewTelegramHandler(store *store.Store) *TelegramHandler {
...
@@ -24,7 +24,7 @@ func NewTelegramHandler(store *store.Store) *TelegramHandler {
}
}
func
(
t
*
TelegramHandler
)
BotToken
(
ctx
context
.
Context
)
string
{
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
(
const
(
...
...
server/service/backup/backup.go
View file @
215981df
...
@@ -25,7 +25,7 @@ func NewBackupRunner(store *store.Store) *BackupRunner {
...
@@ -25,7 +25,7 @@ func NewBackupRunner(store *store.Store) *BackupRunner {
}
}
func
(
r
*
BackupRunner
)
Run
(
ctx
context
.
Context
)
{
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
==
""
{
if
intervalStr
==
""
{
log
.
Debug
(
"no SystemSettingAutoBackupIntervalName setting, disable auto backup"
)
log
.
Debug
(
"no SystemSettingAutoBackupIntervalName setting, disable auto backup"
)
return
return
...
...
store/system_setting.go
View file @
215981df
...
@@ -51,8 +51,8 @@ func (s *Store) GetSystemSetting(ctx context.Context, find *FindSystemSetting) (
...
@@ -51,8 +51,8 @@ func (s *Store) GetSystemSetting(ctx context.Context, find *FindSystemSetting) (
return
systemSettingMessage
,
nil
return
systemSettingMessage
,
nil
}
}
func
(
s
*
Store
)
GetSystemSettingValueWithDefault
(
ctx
*
context
.
Context
,
settingName
string
,
defaultValue
string
)
string
{
func
(
s
*
Store
)
GetSystemSettingValueWithDefault
(
ctx
context
.
Context
,
settingName
string
,
defaultValue
string
)
string
{
if
setting
,
err
:=
s
.
GetSystemSetting
(
*
ctx
,
&
FindSystemSetting
{
if
setting
,
err
:=
s
.
GetSystemSetting
(
ctx
,
&
FindSystemSetting
{
Name
:
settingName
,
Name
:
settingName
,
});
err
==
nil
&&
setting
!=
nil
{
});
err
==
nil
&&
setting
!=
nil
{
return
setting
.
Value
return
setting
.
Value
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment