Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Nestjs Aragami
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
Nestjs Aragami
Commits
93bd5594
Commit
93bd5594
authored
Apr 16, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add i to queue runner
parent
4bd1da3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/queue-runner.ts
src/queue-runner.ts
+9
-8
No files found.
src/queue-runner.ts
View file @
93bd5594
import
{
Aragami
,
ClassType
}
from
'
aragami
'
;
import
{
Logger
}
from
'
@nestjs/common
'
;
import
{
ConsoleLogger
,
Logger
}
from
'
@nestjs/common
'
;
import
*
as
os
from
'
os
'
;
import
{
InjectAragami
}
from
'
../index
'
;
...
...
@@ -29,7 +29,7 @@ export class _QueueRunner<T> {
if
(
this
.
_queueRunnerOptions
.
logTask
)
{
this
.
logger
.
log
(
`Starting worker
${
i
}
`
);
}
this
.
_mainLoop
().
then
();
this
.
_mainLoop
(
i
).
then
();
}
}
...
...
@@ -39,13 +39,14 @@ export class _QueueRunner<T> {
this
.
_quit
=
true
;
}
async
runTask
(
task
:
T
)
{
async
runTask
(
task
:
T
,
i
:
number
)
{
return
;
}
async
_mainLoop
()
{
async
_mainLoop
(
i
:
number
)
{
const
logger
=
new
ConsoleLogger
(
`
${
this
.
_queueClass
.
name
}
-
${
i
}
`
);
while
(
!
this
.
_quit
)
{
this
.
logger
.
log
(
'
Looping
'
);
logger
.
log
(
'
Looping
'
);
try
{
const
task
:
T
=
await
this
.
aragami
.
queueGatherBlocking
(
this
.
_queueClass
,
...
...
@@ -53,11 +54,11 @@ export class _QueueRunner<T> {
);
if
(
!
task
)
continue
;
if
(
this
.
_queueRunnerOptions
.
logTask
)
{
this
.
logger
.
log
(
`Got task:
${
JSON
.
stringify
(
task
)}
`
);
logger
.
log
(
`Got task:
${
JSON
.
stringify
(
task
)}
`
);
}
await
this
.
runTask
(
task
);
await
this
.
runTask
(
task
,
i
);
}
catch
(
e
)
{
this
.
logger
.
error
(
`Loop failed:
${
e
}
`
);
logger
.
error
(
`Loop failed:
${
e
}
`
);
}
}
}
...
...
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