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
250f10fa
authored
Oct 12, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: mask sensitive information in error messages and refine task retrieval query
parent
5feb22d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
model/task.go
+1
-1
service/error.go
+2
-1
No files found.
model/task.go
View file @
250f10fa
...
...
@@ -192,7 +192,7 @@ func GetAllUnFinishSyncTasks(limit int) []*Task {
var
tasks
[]
*
Task
var
err
error
// get all tasks progress is not 100%
err
=
DB
.
Where
(
"progress != ?"
,
"100%"
)
.
Limit
(
limit
)
.
Order
(
"id"
)
.
Find
(
&
tasks
)
.
Error
err
=
DB
.
Where
(
"progress != ?"
,
"100%"
)
.
Where
(
"status != ?"
,
TaskStatusFailure
)
.
Where
(
"status != ?"
,
TaskStatusSuccess
)
.
Limit
(
limit
)
.
Order
(
"id"
)
.
Find
(
&
tasks
)
.
Error
if
err
!=
nil
{
return
nil
}
...
...
service/error.go
View file @
250f10fa
...
...
@@ -142,7 +142,8 @@ func TaskErrorWrapper(err error, code string, statusCode int) *dto.TaskError {
lowerText
:=
strings
.
ToLower
(
text
)
if
strings
.
Contains
(
lowerText
,
"post"
)
||
strings
.
Contains
(
lowerText
,
"dial"
)
||
strings
.
Contains
(
lowerText
,
"http"
)
{
common
.
SysLog
(
fmt
.
Sprintf
(
"error: %s"
,
text
))
text
=
"请求上游地址失败"
//text = "请求上游地址失败"
text
=
common
.
MaskSensitiveInfo
(
text
)
}
//避免暴露内部错误
taskError
:=
&
dto
.
TaskError
{
...
...
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