Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
cache
Commits
8a4e2544
Commit
8a4e2544
authored
Feb 20, 2024
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add publickey
parent
e047b6f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
cache_test.go
cachedata/cache_test.go
+8
-8
payment.go
cachedata/payment.go
+1
-1
taskType.go
model/taskType.go
+1
-0
No files found.
cachedata/cache_test.go
View file @
8a4e2544
...
...
@@ -15,15 +15,15 @@ func newCache() *CacheData {
return
_cache
}
_cache
=
NewCacheData
(
context
.
Background
(),
RedisConnParam
{
Addr
:
"
192.168.1.10
:6379"
,
Password
:
""
,
Addr
:
"
43.198.252.255
:6379"
,
Password
:
"
iH0g2CqzjI6SfercGwsT
"
,
DbIndex
:
0
,
},
model
.
DbConfig
{
Host
:
"
192.168.1.211
"
,
Host
:
"
43.198.252.255
"
,
Port
:
3306
,
DbName
:
"
liuxuzhong
"
,
Passwd
:
"
12345678
"
,
User
:
"
root
"
,
DbName
:
"
ai
"
,
Passwd
:
"
RFnnKHRar5xk7TEF
"
,
User
:
"
ai
"
,
})
return
_cache
}
...
...
@@ -31,8 +31,8 @@ func newCache() *CacheData {
func
TestCacheData_Query
(
t
*
testing
.
T
)
{
cache
:=
newCache
()
testPath
:=
"/
start/docker
"
testUid
:=
int64
(
19
)
testPath
:=
"/
txt2Img/demianhjw/aigic
"
testUid
:=
int64
(
23
)
task
,
err
:=
cache
.
Query
(
testPath
,
testUid
)
if
err
!=
nil
{
...
...
cachedata/payment.go
View file @
8a4e2544
...
...
@@ -291,7 +291,7 @@ func (c *CacheData) costForFee(uid int64, fee int64) error {
}
if
fee
<
0
{
txp
:=
c
.
rdb
.
TxPipeline
()
txp
.
DecrBy
(
c
.
ctx
,
chargeKey
,
fee
)
txp
.
DecrBy
(
c
.
ctx
,
chargeKey
,
-
fee
)
_
,
err
:=
txp
.
Exec
(
c
.
ctx
)
return
err
}
...
...
model/taskType.go
View file @
8a4e2544
...
...
@@ -10,6 +10,7 @@ type TaskType struct {
Desc
string
`orm:"column(desc)" db:"desc" json:"desc" form:"desc"`
// 任务类型描述
Price
int64
`orm:"column(price)" db:"price" json:"price" form:"price"`
// 该任务类型的费用
Complexity
int64
`orm:"column(complexity)" db:"complexity" json:"complexity" form:"complexity"`
PublicKey
string
`orm:"column(public_key)" db:"public_key" json:"public_key" form:"public_key"`
HardwareRequire
string
`orm:"column(hardware_require)" db:"hardware_require" json:"hardware_require" form:"hardware_require"`
ImageId
string
`orm:"column(image_id)" db:"image_id" json:"image_id" form:"image_id"`
ImageUrl
string
`orm:"column(image_url)" db:"image_url" json:"image_url" form:"image_url"`
...
...
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