Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskcenter
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
taskcenter
Commits
f47323ac
Commit
f47323ac
authored
Jan 14, 2025
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add pass resap
parent
b1097bf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
api.go
model/api/api.go
+1
-0
group.go
service/group.go
+9
-0
No files found.
model/api/api.go
View file @
f47323ac
...
@@ -61,6 +61,7 @@ type Task struct {
...
@@ -61,6 +61,7 @@ type Task struct {
Enable
bool
`json:"enable"`
Enable
bool
`json:"enable"`
Msg
string
`json:"msg"`
Msg
string
`json:"msg"`
SubmitTimestamp
int
`json:"submitTimestamp"`
SubmitTimestamp
int
`json:"submitTimestamp"`
Pass
bool
`json:"pass"`
}
}
type
CreateTaskRequest
struct
{
type
CreateTaskRequest
struct
{
...
...
service/group.go
View file @
f47323ac
...
@@ -62,6 +62,7 @@ func (s *Service) GetGroup(gid int, userId string, admin bool) (resp *apiModel.G
...
@@ -62,6 +62,7 @@ func (s *Service) GetGroup(gid int, userId string, admin bool) (resp *apiModel.G
taskResults
:=
make
([]
apiModel
.
Task
,
len
(
tasks
))
taskResults
:=
make
([]
apiModel
.
Task
,
len
(
tasks
))
var
wg
sync
.
WaitGroup
var
wg
sync
.
WaitGroup
var
errCh
=
make
(
chan
error
,
len
(
tasks
))
for
i
:=
range
tasks
{
for
i
:=
range
tasks
{
wg
.
Add
(
1
)
wg
.
Add
(
1
)
...
@@ -80,11 +81,13 @@ func (s *Service) GetGroup(gid int, userId string, admin bool) (resp *apiModel.G
...
@@ -80,11 +81,13 @@ func (s *Service) GetGroup(gid int, userId string, admin bool) (resp *apiModel.G
Daily
:
task
.
Daily
,
Daily
:
task
.
Daily
,
TweetId
:
task
.
TweetId
,
TweetId
:
task
.
TweetId
,
Enable
:
task
.
Enable
,
Enable
:
task
.
Enable
,
Pass
:
task
.
Pass
,
}
}
status
,
submittedAt
,
err
:=
s
.
GetTaskResult
(
_task
.
Daily
,
_task
.
TaskId
.
(
int
),
userId
)
status
,
submittedAt
,
err
:=
s
.
GetTaskResult
(
_task
.
Daily
,
_task
.
TaskId
.
(
int
),
userId
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
WithError
(
err
)
.
Error
(
"group check task"
)
log
.
WithError
(
err
)
.
Error
(
"group check task"
)
errCh
<-
err
return
return
}
}
_task
.
Status
=
status
_task
.
Status
=
status
...
@@ -97,6 +100,12 @@ func (s *Service) GetGroup(gid int, userId string, admin bool) (resp *apiModel.G
...
@@ -97,6 +100,12 @@ func (s *Service) GetGroup(gid int, userId string, admin bool) (resp *apiModel.G
}
}
wg
.
Wait
()
wg
.
Wait
()
if
len
(
errCh
)
>
0
{
err
=
<-
errCh
close
(
errCh
)
return
}
resp
.
Tasks
=
taskResults
resp
.
Tasks
=
taskResults
return
return
}
}
...
...
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