Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
power-node
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
power-node
Commits
44642bba
Commit
44642bba
authored
Mar 31, 2024
by
duanjinfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update task handler
parent
f2771c8b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
490 additions
and
441 deletions
+490
-441
const.go
models/const.go
+4
-0
task_handler.go
nm/task_handler.go
+481
-435
task_msg_test.go
test/task_msg_test.go
+5
-6
No files found.
models/const.go
View file @
44642bba
...
...
@@ -13,9 +13,13 @@ const (
UseRedirect
=
"Use-Redirect"
Prefer
=
"Prefer"
Async
=
"respond-async"
MaxExecTime
=
"MaxExecTime"
HealthCheckAPI
=
"/health-check"
ReplicateImageNameSuffix
=
"docker.agicoin.ai/agicoin"
READY
=
"READY"
ZeroHost
=
"0.0.0.0"
ModelPublishStatusYes
=
1
ModelPublishStatusNo
=
2
DefaultMaxExecTime
=
300
DefaultTaskTimer
=
2
)
nm/task_handler.go
View file @
44642bba
This diff is collapsed.
Click to expand it.
test/task_msg_test.go
View file @
44642bba
...
...
@@ -111,12 +111,11 @@ func TestTaskHandler_computeTaskHandler(t1 *testing.T) {
}
for
_
,
tt
:=
range
tests
{
t1
.
Run
(
tt
.
name
,
func
(
t1
*
testing
.
T
)
{
t
:=
&
nm
.
TaskHandler
{
Wg
:
tt
.
fields
.
wg
,
LruCache
:
tt
.
fields
.
lruCache
,
DockerOp
:
tt
.
fields
.
DockerOp
,
TaskMsg
:
tt
.
fields
.
TaskMsg
,
HttpClient
:
tt
.
fields
.
HttpClient
,
t
:=
&
nm
.
TaskWorker
{
Wg
:
tt
.
fields
.
wg
,
LruCache
:
tt
.
fields
.
lruCache
,
DockerOp
:
tt
.
fields
.
DockerOp
,
TaskMsg
:
tt
.
fields
.
TaskMsg
,
}
tt
.
fields
.
wg
.
Add
(
1
)
t
.
ComputeTaskHandler
(
tt
.
args
.
taskMsg
)
...
...
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