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
Unverified
Commit
230a3592
authored
May 30, 2026
by
skynono
Committed by
GitHub
May 30, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: order admin logs by created_at to use composite index (#5116)
parent
afb470e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
+1
-1
model/log.go
+1
-1
No files found.
model/log.go
View file @
230a3592
...
@@ -354,7 +354,7 @@ func GetAllLogs(logType int, startTimestamp int64, endTimestamp int64, modelName
...
@@ -354,7 +354,7 @@ func GetAllLogs(logType int, startTimestamp int64, endTimestamp int64, modelName
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
0
,
err
return
nil
,
0
,
err
}
}
err
=
tx
.
Order
(
"logs.id desc"
)
.
Limit
(
num
)
.
Offset
(
startIdx
)
.
Find
(
&
logs
)
.
Error
err
=
tx
.
Order
(
"logs.
created_at desc, logs.
id desc"
)
.
Limit
(
num
)
.
Offset
(
startIdx
)
.
Find
(
&
logs
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
0
,
err
return
nil
,
0
,
err
}
}
...
...
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