Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-bee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
gargantext
haskell-bee
Commits
307f6760
Verified
Commit
307f6760
authored
Oct 29, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[worker] fix setMessageTimeout
parent
cb67cc40
Pipeline
#6909
failed with stages
in 1 minute and 22 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
Worker.hs
src/Async/Worker.hs
+3
-4
No files found.
src/Async/Worker.hs
View file @
307f6760
...
...
@@ -124,14 +124,13 @@ handleMessage state@(State { .. }) brokerMessage = do
let
job'
=
toA
msg
-- putStrLn $ formatStr state $ "received job: " <> show (job job')
let
mdata
=
metadata
job'
let
t
=
jobTimeout
job'
let
timeoutS
=
t
*
microsecond
let
timeoutS
=
jobTimeout
job'
-- Inform the broker how long a task could take. This way we prevent
-- the broker from sending this task to another worker (e.g. 'vt' in
-- PGMQ).
setMessageTimeout
broker
queueName
msgId
(
TimeoutS
timeoutS
)
-- mTimeout <- Timeout.timeout timeoutS (wrapPerformActionInJobException state brokerMessage)
mTimeout
<-
Timeout
.
timeout
timeoutS
(
runAction
state
brokerMessage
)
mTimeout
<-
Timeout
.
timeout
(
timeoutS
*
microsecond
)
(
runAction
state
brokerMessage
)
let
archiveHandler
=
do
case
archiveStrategy
mdata
of
...
...
@@ -147,7 +146,7 @@ handleMessage state@(State { .. }) brokerMessage = do
Nothing
->
do
callWorkerJobEvent
onJobTimeout
state
brokerMessage
throwIO
$
JobTimeout
{
jtBMessage
=
brokerMessage
,
jtTimeout
=
t
}
,
jtTimeout
=
t
imeoutS
}
-- onMessageFetched broker queue msg
...
...
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