Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
17f17142
authored
May 13, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: handle errors when update option map
parent
d11134d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
model/option.go
+5
-3
No files found.
model/option.go
View file @
17f17142
...
...
@@ -53,7 +53,10 @@ func InitOptionMap() {
common
.
OptionMapRWMutex
.
Unlock
()
options
,
_
:=
AllOption
()
for
_
,
option
:=
range
options
{
updateOptionMap
(
option
.
Key
,
option
.
Value
)
err
:=
updateOptionMap
(
option
.
Key
,
option
.
Value
)
if
err
!=
nil
{
common
.
SysError
(
"Failed to update option map: "
+
err
.
Error
())
}
}
}
...
...
@@ -70,8 +73,7 @@ func UpdateOption(key string, value string) error {
// otherwise it will execute Update (with all fields).
DB
.
Save
(
&
option
)
// Update OptionMap
updateOptionMap
(
key
,
value
)
return
nil
return
updateOptionMap
(
key
,
value
)
}
func
updateOptionMap
(
key
string
,
value
string
)
(
err
error
)
{
...
...
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