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
9dfec964
Commit
9dfec964
authored
Aug 27, 2024
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review: remove call to traceStack
parent
0e73b8d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
REVIEW.md
REVIEW.md
+5
-0
Worker.hs
src/Async/Worker.hs
+1
-4
No files found.
REVIEW.md
View file @
9dfec964
...
...
@@ -67,3 +67,8 @@ src/Async/Worker.hs:277:22: error: [-Wredundant-constraints, -Werror=redundant-c
277 | mkDefaultSendJob' :: HasWorkerBroker b a
|
```
# Do not use `Debug.Trace` logging in library code
As the name implies,
`Debug.Trace`
& co are really only for debugging purposes, and is not recommended
to leave them in library code,
`traceStack`
being a primary example.
src/Async/Worker.hs
View file @
9dfec964
...
...
@@ -41,7 +41,6 @@ import Control.Concurrent.STM (atomically)
import
Control.Concurrent.STM.TVar
(
readTVarIO
,
newTVarIO
,
writeTVar
)
import
Control.Exception.Safe
(
catches
,
Handler
(
..
),
throwIO
,
SomeException
,
Exception
)
import
Control.Monad
(
forever
,
void
,
when
)
import
Debug.Trace
(
traceStack
)
import
System.Timeout
qualified
as
Timeout
...
...
@@ -223,9 +222,7 @@ handleJobError _state@(State { .. }) brokerMessage = do
void
$
sendJob
broker
queueName
(
job
{
metadata
=
mdata
{
readCount
=
readCt
+
1
}
})
handleUnknownError
::
State
b
a
->
SomeException
->
IO
()
handleUnknownError
state
err
=
do
let
_
=
traceStack
(
"unknown error: "
<>
show
err
)
putStrLn
$
formatStr
state
$
"unknown error: "
<>
show
err
handleUnknownError
state
err
=
putStrLn
$
formatStr
state
$
"unknown error: "
<>
show
err
sendJob
::
(
HasWorkerBroker
b
a
)
=>
Broker
b
(
Job
a
)
->
Queue
->
Job
a
->
IO
(
MessageId
b
)
sendJob
broker
queueName
job
=
do
...
...
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