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
fad5fc3f
authored
Aug 02, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: truncate abilities table before processing channels
parent
8ceda7b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
model/ability.go
+16
-1
No files found.
model/ability.go
View file @
fad5fc3f
...
@@ -284,9 +284,24 @@ func FixAbility() (int, int, error) {
...
@@ -284,9 +284,24 @@ func FixAbility() (int, int, error) {
return
0
,
0
,
errors
.
New
(
"已经有一个修复任务在运行中,请稍后再试"
)
return
0
,
0
,
errors
.
New
(
"已经有一个修复任务在运行中,请稍后再试"
)
}
}
defer
fixLock
.
Unlock
()
defer
fixLock
.
Unlock
()
// truncate abilities table
if
common
.
UsingSQLite
{
err
:=
DB
.
Exec
(
"DELETE FROM abilities"
)
.
Error
if
err
!=
nil
{
common
.
SysError
(
fmt
.
Sprintf
(
"Delete abilities failed: %s"
,
err
.
Error
()))
return
0
,
0
,
err
}
}
else
{
err
:=
DB
.
Exec
(
"TRUNCATE TABLE abilities"
)
.
Error
if
err
!=
nil
{
common
.
SysError
(
fmt
.
Sprintf
(
"Truncate abilities failed: %s"
,
err
.
Error
()))
return
0
,
0
,
err
}
}
var
channels
[]
*
Channel
var
channels
[]
*
Channel
// Find all channels
// Find all channels
err
:
=
DB
.
Model
(
&
Channel
{})
.
Find
(
&
channels
)
.
Error
err
=
DB
.
Model
(
&
Channel
{})
.
Find
(
&
channels
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
return
0
,
0
,
err
return
0
,
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