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
0a86ce01
authored
Jun 26, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sqlite too many SQL variables
parent
6e92f1f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
model/ability.go
+6
-1
No files found.
model/ability.go
View file @
0a86ce01
...
@@ -56,6 +56,11 @@ func getPriority(group string, model string, retry int) (int, error) {
...
@@ -56,6 +56,11 @@ func getPriority(group string, model string, retry int) (int, error) {
return
0
,
err
return
0
,
err
}
}
if
len
(
priorities
)
==
0
{
// 如果没有查询到优先级,则返回错误
return
0
,
errors
.
New
(
"数据库一致性被破坏"
)
}
// 确定要使用的优先级
// 确定要使用的优先级
var
priorityToUse
int
var
priorityToUse
int
if
retry
>=
len
(
priorities
)
{
if
retry
>=
len
(
priorities
)
{
...
@@ -199,7 +204,7 @@ func FixAbility() (int, error) {
...
@@ -199,7 +204,7 @@ func FixAbility() (int, error) {
// Use channelIds to find channel not in abilities table
// Use channelIds to find channel not in abilities table
var
abilityChannelIds
[]
int
var
abilityChannelIds
[]
int
err
=
DB
.
Model
(
&
Ability
{}
)
.
Pluck
(
"channel_id"
,
&
abilityChannelIds
)
.
Error
err
=
DB
.
Table
(
"abilities"
)
.
Distinct
(
"channel_id"
)
.
Pluck
(
"channel_id"
,
&
abilityChannelIds
)
.
Error
if
err
!=
nil
{
if
err
!=
nil
{
common
.
SysError
(
fmt
.
Sprintf
(
"Get channel ids from abilities table failed: %s"
,
err
.
Error
()))
common
.
SysError
(
fmt
.
Sprintf
(
"Get channel ids from abilities table failed: %s"
,
err
.
Error
()))
return
0
,
err
return
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